1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-02 05:57:46 +00:00

Merge branch 'master' of https://github.com/uutils/coreutils into sort-no-json-extsort

This commit is contained in:
Michael Debertol 2021-05-01 17:29:03 +02:00
commit be0c924c95
8 changed files with 47 additions and 45 deletions

46
Cargo.lock generated
View file

@ -12,11 +12,11 @@ dependencies = [
[[package]] [[package]]
name = "aho-corasick" name = "aho-corasick"
version = "0.7.15" version = "0.7.18"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "7404febffaa47dac81aa44dba71523c9d069b1bdc50a77db41195149e17f68e5" checksum = "1e37cfd5e7657ada45f742d6e99ca5788580b5c529dc78faf11ece6dc702656f"
dependencies = [ dependencies = [
"memchr 2.3.4", "memchr 2.4.0",
] ]
[[package]] [[package]]
@ -111,7 +111,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d" checksum = "a40b47ad93e1a5404e6c18dec46b628214fee441c70f4ab5d6942142cc268a3d"
dependencies = [ dependencies = [
"lazy_static", "lazy_static",
"memchr 2.3.4", "memchr 2.4.0",
"regex-automata", "regex-automata",
"serde", "serde",
] ]
@ -495,9 +495,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-epoch" name = "crossbeam-epoch"
version = "0.9.3" version = "0.9.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2584f639eb95fea8c798496315b297cf81b9b58b6d30ab066a75455333cf4b12" checksum = "52fb27eab85b17fbb9f6fd667089e07d6a2eb8743d02639ee7f6a7a7729c9c94"
dependencies = [ dependencies = [
"cfg-if 1.0.0", "cfg-if 1.0.0",
"crossbeam-utils", "crossbeam-utils",
@ -508,9 +508,9 @@ dependencies = [
[[package]] [[package]]
name = "crossbeam-utils" name = "crossbeam-utils"
version = "0.8.3" version = "0.8.4"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "e7e9d99fa91428effe99c5c6d4634cdeba32b8cf784fc428a2a687f61a952c49" checksum = "4feb231f0d4d6af81aed15928e58ecf5816aa62a2393e2c82f46973e92a9a278"
dependencies = [ dependencies = [
"autocfg", "autocfg",
"cfg-if 1.0.0", "cfg-if 1.0.0",
@ -536,7 +536,7 @@ version = "0.1.10"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90" checksum = "2b2466559f260f48ad25fe6317b3c8dac77b5bdb5763ac7d9d6103530663bc90"
dependencies = [ dependencies = [
"memchr 2.3.4", "memchr 2.4.0",
] ]
[[package]] [[package]]
@ -868,9 +868,9 @@ dependencies = [
[[package]] [[package]]
name = "memchr" name = "memchr"
version = "2.3.4" version = "2.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "0ee1c47aaa256ecabcaea351eae4a9b01ef39ed810004e298d2511ed284b1525" checksum = "b16bd47d9e329435e309c58469fe0791c2d0d1ba96ec0954152a5ae2b04387dc"
[[package]] [[package]]
name = "memoffset" name = "memoffset"
@ -1089,7 +1089,7 @@ version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec" checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"
dependencies = [ dependencies = [
"unicode-xid 0.2.1", "unicode-xid 0.2.2",
] ]
[[package]] [[package]]
@ -1277,12 +1277,12 @@ dependencies = [
[[package]] [[package]]
name = "regex" name = "regex"
version = "1.4.6" version = "1.5.1"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "2a26af418b574bd56588335b3a3659a65725d4e636eb1016c2f9e3b38c7cc759" checksum = "a068b905b8cb93815aa3069ae48653d90f382308aebd1d33d940ac1f1d771e2d"
dependencies = [ dependencies = [
"aho-corasick", "aho-corasick",
"memchr 2.3.4", "memchr 2.4.0",
"regex-syntax", "regex-syntax",
] ]
@ -1297,9 +1297,9 @@ dependencies = [
[[package]] [[package]]
name = "regex-syntax" name = "regex-syntax"
version = "0.6.23" version = "0.6.24"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "24d5f089152e60f62d28b835fbff2cd2e8dc0baf1ac13343bef92ab7eed84548" checksum = "00efb87459ba4f6fb2169d20f68565555688e1250ee6825cdf6254f8b48fafb2"
[[package]] [[package]]
name = "remove_dir_all" name = "remove_dir_all"
@ -1483,7 +1483,7 @@ checksum = "ad184cc9470f9117b2ac6817bfe297307418819ba40552f9b3846f05c33d5373"
dependencies = [ dependencies = [
"proc-macro2", "proc-macro2",
"quote 1.0.9", "quote 1.0.9",
"unicode-xid 0.2.1", "unicode-xid 0.2.2",
] ]
[[package]] [[package]]
@ -1630,9 +1630,9 @@ checksum = "8c1f860d7d29cf02cb2f3f359fd35991af3d30bac52c57d265a3c461074cb4dc"
[[package]] [[package]]
name = "unicode-xid" name = "unicode-xid"
version = "0.2.1" version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "f7fe0bb3479651439c9112f72b6c505038574c9fbb575ed1bf3b797fa39dd564" checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]] [[package]]
name = "unindent" name = "unindent"
@ -1800,7 +1800,7 @@ version = "0.0.6"
dependencies = [ dependencies = [
"bstr", "bstr",
"clap", "clap",
"memchr 2.3.4", "memchr 2.4.0",
"uucore", "uucore",
"uucore_procs", "uucore_procs",
] ]
@ -2169,7 +2169,7 @@ dependencies = [
"aho-corasick", "aho-corasick",
"clap", "clap",
"libc", "libc",
"memchr 2.3.4", "memchr 2.4.0",
"regex", "regex",
"regex-syntax", "regex-syntax",
"uucore", "uucore",
@ -2270,7 +2270,7 @@ dependencies = [
"aho-corasick", "aho-corasick",
"clap", "clap",
"libc", "libc",
"memchr 2.3.4", "memchr 2.4.0",
"regex", "regex",
"regex-syntax", "regex-syntax",
"uucore", "uucore",

View file

@ -125,7 +125,7 @@ fn _factor<A: Arithmetic + miller_rabin::Basis>(num: u64, f: Factors) -> Factors
let n = A::new(num); let n = A::new(num);
let divisor = match miller_rabin::test::<A>(n) { let divisor = match miller_rabin::test::<A>(n) {
Prime => { Prime => {
#[cfg(feature="coz")] #[cfg(feature = "coz")]
coz::progress!("factor found"); coz::progress!("factor found");
let mut r = f; let mut r = f;
r.push(num); r.push(num);
@ -141,7 +141,7 @@ fn _factor<A: Arithmetic + miller_rabin::Basis>(num: u64, f: Factors) -> Factors
} }
pub fn factor(mut n: u64) -> Factors { pub fn factor(mut n: u64) -> Factors {
#[cfg(feature="coz")] #[cfg(feature = "coz")]
coz::begin!("factorization"); coz::begin!("factorization");
let mut factors = Factors::one(); let mut factors = Factors::one();
@ -156,7 +156,7 @@ pub fn factor(mut n: u64) -> Factors {
} }
if n == 1 { if n == 1 {
#[cfg(feature="coz")] #[cfg(feature = "coz")]
coz::end!("factorization"); coz::end!("factorization");
return factors; return factors;
} }
@ -169,7 +169,7 @@ pub fn factor(mut n: u64) -> Factors {
_factor::<Montgomery<u64>>(n, factors) _factor::<Montgomery<u64>>(n, factors)
}; };
#[cfg(feature="coz")] #[cfg(feature = "coz")]
coz::end!("factorization"); coz::end!("factorization");
return r; return r;

View file

@ -33,7 +33,7 @@ pub(crate) fn factor(mut num: u64, mut factors: Factors) -> (Factors, u64) {
if x <= ceil { if x <= ceil {
num = x; num = x;
k += 1; k += 1;
#[cfg(feature="coz")] #[cfg(feature = "coz")]
coz::progress!("factor found"); coz::progress!("factor found");
} else { } else {
if k > 0 { if k > 0 {

View file

@ -1559,6 +1559,7 @@ fn get_system_time(md: &Metadata, config: &Config) -> Option<SystemTime> {
match config.time { match config.time {
Time::Modification => md.modified().ok(), Time::Modification => md.modified().ok(),
Time::Access => md.accessed().ok(), Time::Access => md.accessed().ok(),
Time::Birth => md.created().ok(),
_ => None, _ => None,
} }
} }

View file

@ -158,7 +158,6 @@ pub fn base_conv_float(src: &[u8], radix_src: u8, _radix_dest: u8) -> f64 {
// to implement this for arbitrary string input. // to implement this for arbitrary string input.
// until then, the below operates as an outline // until then, the below operates as an outline
// of how it would work. // of how it would work.
let result: Vec<u8> = vec![0];
let mut factor: f64 = 1_f64; let mut factor: f64 = 1_f64;
let radix_src_float: f64 = f64::from(radix_src); let radix_src_float: f64 = f64::from(radix_src);
let mut r: f64 = 0_f64; let mut r: f64 = 0_f64;

View file

@ -559,8 +559,7 @@ fn test_ls_long_ctime() {
} }
#[test] #[test]
#[cfg(not(windows))] #[ignore]
// This test is currently failing on windows
fn test_ls_order_birthtime() { fn test_ls_order_birthtime() {
let scene = TestScenario::new(util_name!()); let scene = TestScenario::new(util_name!());
let at = &scene.fixtures; let at = &scene.fixtures;
@ -570,15 +569,11 @@ fn test_ls_order_birthtime() {
After creating the first file try to sync it. After creating the first file try to sync it.
This ensures the file gets created immediately instead of being saved This ensures the file gets created immediately instead of being saved
inside the OS's IO operation buffer. inside the OS's IO operation buffer.
Without this, both files might accidentally be created at the same time, Without this, both files might accidentally be created at the same time.
even though we placed a timeout between creating the two.
https://github.com/uutils/coreutils/pull/1986/#issuecomment-828490651
*/ */
at.make_file("test-birthtime-1").sync_all().unwrap(); at.make_file("test-birthtime-1").sync_all().unwrap();
std::thread::sleep(std::time::Duration::from_millis(1)); at.make_file("test-birthtime-2").sync_all().unwrap();
at.make_file("test-birthtime-2"); at.open("test-birthtime-1");
at.touch("test-birthtime-1");
let result = scene.ucmd().arg("--time=birth").arg("-t").run(); let result = scene.ucmd().arg("--time=birth").arg("-t").run();
@ -589,6 +584,7 @@ fn test_ls_order_birthtime() {
} }
#[test] #[test]
#[ignore]
fn test_ls_styles() { fn test_ls_styles() {
let scene = TestScenario::new(util_name!()); let scene = TestScenario::new(util_name!());
let at = &scene.fixtures; let at = &scene.fixtures;

View file

@ -224,8 +224,14 @@ fn test_size_and_reference() {
let mut file1 = at.make_file(TFILE1); let mut file1 = at.make_file(TFILE1);
let mut file2 = at.make_file(TFILE2); let mut file2 = at.make_file(TFILE2);
file1.write_all(b"1234567890").unwrap(); file1.write_all(b"1234567890").unwrap();
ucmd.args(&["--reference", TFILE1, "--size", "+5", TFILE2]).succeeds(); ucmd.args(&["--reference", TFILE1, "--size", "+5", TFILE2])
.succeeds();
file2.seek(SeekFrom::End(0)).unwrap(); file2.seek(SeekFrom::End(0)).unwrap();
let actual = file2.seek(SeekFrom::Current(0)).unwrap(); let actual = file2.seek(SeekFrom::Current(0)).unwrap();
assert!(expected == actual, "expected '{}' got '{}'", expected, actual); assert!(
expected == actual,
"expected '{}' got '{}'",
expected,
actual
);
} }