-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
rm: fix gnu coreutils test one-file-system.sh #9428
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
base: main
Are you sure you want to change the base?
Conversation
|
GNU testsuite comparison: |
| rm-error-dangerous-recursive-operation = it is dangerous to operate recursively on '/' | ||
| rm-error-use-no-preserve-root = use --no-preserve-root to override this failsafe | ||
| rm-error-refusing-to-remove-directory = refusing to remove '.' or '..' directory: skipping '{$path}' | ||
| rm-error-skipping-directory-on-different-device = skipping '{$path}', since it's on a different device |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this isn't in the french file
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Added
tests/by-util/test_rm.rs
Outdated
| at.mkdir_all(a_b); | ||
| at.mkdir_all(t_y); | ||
|
|
||
| #[cfg(any(target_os = "linux", target_os = "macos"))] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can you do one function for linux
and another for macos ?
it is too hard to understand correctly
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Improved readability
|
GNU testsuite comparison: |
src/uu/rm/src/rm.rs
Outdated
|
|
||
| // Recursive case: this is a directory. | ||
| let mut error = false; | ||
| #[cfg(unix)] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
dup code from line 665
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix is
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
1 similar comment
|
GNU testsuite comparison: |
CodSpeed Performance ReportMerging #9428 will not alter performanceComparing Summary
Footnotes
|
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
| }, | ||
| one_fs: matches.get_flag(OPT_ONE_FILE_SYSTEM), | ||
| preserve_root: !matches.get_flag(OPT_NO_PRESERVE_ROOT), | ||
| preserve_root_all: matches |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please fix clippy here
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/uu/rm/src/rm.rs
Outdated
| _parent_dev_id: Option<u64>, | ||
| ) -> bool { | ||
| #[cfg(unix)] | ||
| let parent_dev_id = _parent_dev_id; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i am not a fan of the _parent_dev_id usage
please make it optional instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/uu/rm/src/rm.rs
Outdated
| #[cfg(unix)] | ||
| let parent_dev_id = _parent_dev_id; | ||
|
|
||
| let metadata = match path.symlink_metadata() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can use unwrap_or_else instead
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
src/uu/rm/src/platform/linux.rs
Outdated
|
|
||
| if is_dir { | ||
| if check_device { | ||
| if let Some(parent_dev_id) = parent_dev_id { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
quite duplicated from line 649
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fix
|
i see 3 conflicts |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
3 similar comments
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
|
GNU testsuite comparison: |
src/uu/date/src/locale.rs
Outdated
| cfg_langinfo! { | ||
| use super::*; | ||
|
|
||
| fn has_date_component(format: &str) -> bool { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think it is unrelated to the rm change no?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry fix
| use crate::error::{UError, UResult}; | ||
| use crate::translate; | ||
| use chrono::Local; | ||
| use fluent::FluentArgs; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, unrelated ?
d8875f6 to
0da3869
Compare
|
GNU testsuite comparison: |
0da3869 to
fe51531
Compare
Add "tmpfs" to the spell-checker ignore comment in test_rm.rs to suppress warnings for this filesystem type term used in the tests.
|
GNU testsuite comparison: |
…e_root_all - Changed preserve_root_all to retrieve device ID from parent directory's symlink metadata instead of file's metadata - Maintains one_fs option using file's metadata - Improves accuracy for preserving root directory across filesystems on Unix systems
|
GNU testsuite comparison: |
| } | ||
|
|
||
| #[cfg(unix)] | ||
| fn should_skip_different_device( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this function should be removed
should_skip_different_device_with_dev should be called directly
| progress_bar: Option<&ProgressBar>, | ||
| parent_dev_id: Option<u64>, | ||
| ) -> bool { | ||
| remove_dir_recursive_impl(path, options, progress_bar, parent_dev_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same, not a very interesting function
| options: &Options, | ||
| progress_bar: Option<&ProgressBar>, | ||
| ) -> bool { | ||
| remove_dir_recursive_impl(path, options, progress_bar, None) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
| progress_bar: Option<&ProgressBar>, | ||
| parent_dev_id: Option<u64>, | ||
| ) -> bool { | ||
| remove_dir_recursive(path, options, progress_bar, parent_dev_id) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
same
Summary
Remove the extra leading rm: from the rm-error-preserve-root-all locale strings so the message matches expected test output.
Keep wording otherwise unchanged across en-US and fr-FR locales.
#9127