1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-29 12:07:46 +00:00

Merge pull request #4340 from howjmay/remove_dir_all

rm: Remove remove_dir_all dependency
This commit is contained in:
Terts Diepraam 2023-02-11 12:32:24 +01:00 committed by GitHub
commit d2c047c0ab
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 3 additions and 24 deletions

16
Cargo.lock generated
View file

@ -1827,19 +1827,6 @@ dependencies = [
"winapi", "winapi",
] ]
[[package]]
name = "remove_dir_all"
version = "0.7.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "882f368737489ea543bc5c340e6f3d34a28c39980bd9a979e47322b26f60ac40"
dependencies = [
"libc",
"log",
"num_cpus",
"rayon",
"winapi",
]
[[package]] [[package]]
name = "retain_mut" name = "retain_mut"
version = "0.1.7" version = "0.1.7"
@ -2148,7 +2135,7 @@ dependencies = [
"fastrand", "fastrand",
"libc", "libc",
"redox_syscall", "redox_syscall",
"remove_dir_all 0.5.3", "remove_dir_all",
"winapi", "winapi",
] ]
@ -2950,7 +2937,6 @@ version = "0.0.17"
dependencies = [ dependencies = [
"clap", "clap",
"libc", "libc",
"remove_dir_all 0.7.0",
"uucore", "uucore",
"walkdir", "walkdir",
"windows-sys", "windows-sys",

View file

@ -58,10 +58,7 @@ highlight = "all"
# For each duplicate dependency, indicate the name of the dependency which # For each duplicate dependency, indicate the name of the dependency which
# introduces it. # introduces it.
# spell-checker: disable # spell-checker: disable
skip = [ skip = []
# tempfile
{ name = "remove_dir_all", version = "=0.5.3" },
]
# spell-checker: enable # spell-checker: enable
# This section is considered when running `cargo deny check sources`. # This section is considered when running `cargo deny check sources`.

View file

@ -17,7 +17,6 @@ path = "src/rm.rs"
[dependencies] [dependencies]
clap = { version = "4.0", features = ["wrap_help", "cargo"] } clap = { version = "4.0", features = ["wrap_help", "cargo"] }
walkdir = "2.2" walkdir = "2.2"
remove_dir_all = "0.7.0"
uucore = { version=">=0.0.17", package="uucore", path="../../uucore", features=["fs"] } uucore = { version=">=0.0.17", package="uucore", path="../../uucore", features=["fs"] }
[target.'cfg(unix)'.dependencies] [target.'cfg(unix)'.dependencies]

View file

@ -8,7 +8,6 @@
// spell-checker:ignore (path) eacces // spell-checker:ignore (path) eacces
use clap::{crate_version, parser::ValueSource, Arg, ArgAction, Command}; use clap::{crate_version, parser::ValueSource, Arg, ArgAction, Command};
use remove_dir_all::remove_dir_all;
use std::collections::VecDeque; use std::collections::VecDeque;
use std::fs::{self, File, Metadata}; use std::fs::{self, File, Metadata};
use std::io::ErrorKind; use std::io::ErrorKind;
@ -298,9 +297,7 @@ fn handle_dir(path: &Path, options: &Options) -> bool {
let is_root = path.has_root() && path.parent().is_none(); let is_root = path.has_root() && path.parent().is_none();
if options.recursive && (!is_root || !options.preserve_root) { if options.recursive && (!is_root || !options.preserve_root) {
if options.interactive != InteractiveMode::Always && !options.verbose { if options.interactive != InteractiveMode::Always && !options.verbose {
// we need the extra crate because apparently fs::remove_dir_all() does not function if let Err(e) = fs::remove_dir_all(path) {
// correctly on Windows
if let Err(e) = remove_dir_all(path) {
had_err = true; had_err = true;
if e.kind() == std::io::ErrorKind::PermissionDenied { if e.kind() == std::io::ErrorKind::PermissionDenied {
// GNU compatibility (rm/fail-eacces.sh) // GNU compatibility (rm/fail-eacces.sh)