Skip to content
Open
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
3 changes: 2 additions & 1 deletion src/uucore/src/lib/features/perms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,14 @@ pub fn wrap_chown<P: AsRef<Path>>(
VerbosityLevel::Silent => (),
level => {
out = format!(
"changing {} of {}: {e}",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should also add localised messages for this.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup, good catch, either error-changing-group-failed and error-changing-ownership-failed or a single error-change-failed with 3 strings, we can do that after this is merged :)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is still draft

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@sylvestre can be merged now

"changing {} of {}: {}",
if verbosity.groups_only {
"group"
} else {
"ownership"
},
path.quote(),
strip_errno(&e),
);
if level == VerbosityLevel::Verbose {
out = if verbosity.groups_only {
Expand Down
4 changes: 2 additions & 2 deletions tests/by-util/test_chgrp.rs
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ fn test_reference() {
.arg("/etc")
.fails()
// group name can differ, so just check the first part of the message
.stderr_contains("chgrp: changing group of '/etc': Operation not permitted (os error 1)\nfailed to change group of '/etc' from ");
.stderr_contains("chgrp: changing group of '/etc': Operation not permitted\nfailed to change group of '/etc' from ");
}

#[test]
Expand Down Expand Up @@ -277,7 +277,7 @@ fn test_big_p() {
.arg("/proc/self/cwd")
.fails()
.stderr_contains(
"chgrp: changing group of '/proc/self/cwd': Operation not permitted (os error 1)\n",
"chgrp: changing group of '/proc/self/cwd': Operation not permitted\n",
);
}
}
Expand Down
Loading