Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rm: Remove remove_dir_all dependency #4340

Merged
merged 1 commit into from
Feb 11, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 1 addition & 15 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 1 addition & 4 deletions deny.toml
Original file line number Diff line number Diff line change
Expand Up @@ -58,10 +58,7 @@ highlight = "all"
# For each duplicate dependency, indicate the name of the dependency which
# introduces it.
# spell-checker: disable
skip = [
# tempfile
{ name = "remove_dir_all", version = "=0.5.3" },
]
skip = []
# spell-checker: enable

# This section is considered when running `cargo deny check sources`.
Expand Down
1 change: 0 additions & 1 deletion src/uu/rm/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ path = "src/rm.rs"
[dependencies]
clap = { version = "4.0", features = ["wrap_help", "cargo"] }
walkdir = "2.2"
remove_dir_all = "0.7.0"
uucore = { version=">=0.0.17", package="uucore", path="../../uucore", features=["fs"] }

[target.'cfg(unix)'.dependencies]
Expand Down
5 changes: 1 addition & 4 deletions src/uu/rm/src/rm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
// spell-checker:ignore (path) eacces

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