From 13ce9e4f64ba324e9cd62fc3780951ab5683c205 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Sun, 17 Nov 2024 19:31:36 -0600 Subject: [PATCH] update uutils crates (#14371) # Description This PR updates the uutils/coreutils crates to the latest version. I hard-coded debug to false, a new uu_mv parameter. It may be interesting to add that but I just wanted to get all the uu crates on the same version. I had to update the tests because --no-clobber works but doesn't say anything when it's not clobbering and previously we were checking for an error message. # User-Facing Changes # Tests + Formatting # After Submitting --- Cargo.lock | 34 +++++++++---------- Cargo.toml | 14 ++++---- crates/nu-command/src/filesystem/umv.rs | 1 + crates/nu-command/tests/commands/move_/umv.rs | 9 +++-- crates/nu-command/tests/commands/ucp.rs | 11 +++--- 5 files changed, 37 insertions(+), 32 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 884f1993d9..e6cef1232b 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -6709,9 +6709,9 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uu_cp" -version = "0.0.27" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fb99d355ccb02e8c514e4a1d93e4aa4eedea9837de24635dfd24c165971444e" +checksum = "e0eff79f5eacf6bb88c9afc19f3cec2ab14ad31317be1369100658b46d41e410" dependencies = [ "clap", "filetime", @@ -6725,9 +6725,9 @@ dependencies = [ [[package]] name = "uu_mkdir" -version = "0.0.27" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "219588fbc146f18188781208ac4034616c51cf151677b4e1f9caf63ca8a7f2cf" +checksum = "feba7cf875eecbb746b1c5a5a8a031ab3a00e5f44f5441643a06b78577780d3a" dependencies = [ "clap", "uucore", @@ -6735,9 +6735,9 @@ dependencies = [ [[package]] name = "uu_mktemp" -version = "0.0.27" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1e79ad2c5911908fce23a6069c52ca82e1997e2ed4bf6abf2d867c79c3dc73f" +checksum = "1a9cfd389f60e667c5ee6659beaad50bada7e710d76082c7d77ab91e04307c8f" dependencies = [ "clap", "rand", @@ -6747,9 +6747,9 @@ dependencies = [ [[package]] name = "uu_mv" -version = "0.0.27" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd57c8d02f8a99ed56ed9f6fddab403ee0e2bf9e8f3a5ca8f0f9e4d6e3e392a0" +checksum = "bf932231fccdf108f75443bab0ce17acfe49b5825d731b8a358251833be7da20" dependencies = [ "clap", "fs_extra", @@ -6773,9 +6773,9 @@ dependencies = [ [[package]] name = "uu_uname" -version = "0.0.27" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1ca90f9b292bccaad0de70e6feccac5182c6713a5e1ca72d97bf3555b608b4" +checksum = "182b4071a2e6f7288cbbc1b1ff05c74e9dc7527b4735583d9e3cd92802b06910" dependencies = [ "clap", "platform-info", @@ -6784,27 +6784,27 @@ dependencies = [ [[package]] name = "uu_whoami" -version = "0.0.27" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc7c52e42e0425710461700adc1063f468f2ba8a8ff83ee69ba661095ab7b77a" +checksum = "5d15200414428c65f95d0b1d1226fc84f74ae80376bfe59959d93ddf57f944f5" dependencies = [ "clap", "libc", "uucore", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] name = "uucore" -version = "0.0.27" +version = "0.0.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b54aad02cf7e96f5fafabb6b836efa73eef934783b17530095a29ffd4fdc154" +checksum = "04ea43050c46912575654c5181f4135529e8d4003fca80803af10cdef3ca6412" dependencies = [ "clap", "dunce", "glob", "libc", - "nix 0.28.0", + "nix 0.29.0", "number_prefix", "once_cell", "os_display", @@ -6812,7 +6812,7 @@ dependencies = [ "walkdir", "wild", "winapi-util", - "windows-sys 0.48.0", + "windows-sys 0.59.0", "xattr", ] diff --git a/Cargo.toml b/Cargo.toml index 0297f5fdb5..0b796573c8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -165,14 +165,14 @@ unicode-segmentation = "1.12" unicode-width = "0.1" ureq = { version = "2.10", default-features = false } url = "2.2" -uu_cp = "0.0.27" -uu_mkdir = "0.0.27" -uu_mktemp = "0.0.27" -uu_mv = "0.0.27" +uu_cp = "0.0.28" +uu_mkdir = "0.0.28" +uu_mktemp = "0.0.28" +uu_mv = "0.0.28" uu_touch = "0.0.28" -uu_whoami = "0.0.27" -uu_uname = "0.0.27" -uucore = "0.0.27" +uu_whoami = "0.0.28" +uu_uname = "0.0.28" +uucore = "0.0.28" uuid = "1.11.0" v_htmlescape = "0.15.0" wax = "0.6" diff --git a/crates/nu-command/src/filesystem/umv.rs b/crates/nu-command/src/filesystem/umv.rs index 0f49a7d97d..929fc7bcbb 100644 --- a/crates/nu-command/src/filesystem/umv.rs +++ b/crates/nu-command/src/filesystem/umv.rs @@ -188,6 +188,7 @@ impl Command for UMv { target_dir: None, no_target_dir: false, strip_slashes: false, + debug: false, }; if let Err(error) = uu_mv::mv(&files, &options) { return Err(ShellError::GenericError { diff --git a/crates/nu-command/tests/commands/move_/umv.rs b/crates/nu-command/tests/commands/move_/umv.rs index b193d5b7cb..98e2a753bf 100644 --- a/crates/nu-command/tests/commands/move_/umv.rs +++ b/crates/nu-command/tests/commands/move_/umv.rs @@ -513,13 +513,18 @@ fn test_mv_no_clobber() { sandbox.with_files(&[EmptyFile(file_a)]); sandbox.with_files(&[EmptyFile(file_b)]); - let actual = nu!( + let _ = nu!( cwd: dirs.test(), "mv -n {} {}", file_a, file_b, ); - assert!(actual.err.contains("not replacing")); + + let file_count = nu!( + cwd: dirs.test(), + "ls test_mv* | length | to nuon" + ); + assert_eq!(file_count.out, "2"); }) } diff --git a/crates/nu-command/tests/commands/ucp.rs b/crates/nu-command/tests/commands/ucp.rs index eb2363e68c..e3fa2ca931 100644 --- a/crates/nu-command/tests/commands/ucp.rs +++ b/crates/nu-command/tests/commands/ucp.rs @@ -841,14 +841,13 @@ fn test_cp_arg_no_clobber() { let target = dirs.fixtures.join("cp").join(TEST_HOW_ARE_YOU_SOURCE); let target_hash = get_file_hash(target.display()); - let actual = nu!( - cwd: dirs.root(), - "cp {} {} --no-clobber", - src.display(), - target.display() + let _ = nu!( + cwd: dirs.root(), + "cp {} {} --no-clobber", + src.display(), + target.display() ); let after_cp_hash = get_file_hash(target.display()); - assert!(actual.err.contains("not replacing")); // Check content was not clobbered assert_eq!(after_cp_hash, target_hash); });