install: fix the error message

should fix: tests/install/basic-1.sh
This commit is contained in:
Sylvestre Ledru 2025-11-08 10:58:03 +01:00
parent 3eda1022fd
commit 30dbdf7ac7
3 changed files with 3 additions and 3 deletions

View file

@ -22,7 +22,7 @@ install-help-default-context = set SELinux security context of destination file
# Error messages
install-error-dir-needs-arg = { $util_name } with -d requires at least one argument.
install-error-create-dir-failed = failed to create { $path }
install-error-create-dir-failed = cannot create directory { $path }
install-error-chmod-failed = failed to chmod { $path }
install-error-chmod-failed-detailed = { $path }: chmod failed with error { $error }
install-error-chown-failed = failed to chown { $path }: { $error }

View file

@ -472,7 +472,7 @@ fn directory(paths: &[OsString], b: &Behavior) -> UResult<()> {
// the default mode. Hence it is safe to use fs::create_dir_all
// and then only modify the target's dir mode.
if let Err(e) = fs::create_dir_all(path_to_create.as_path())
.map_err_context(|| path_to_create.as_path().maybe_quote().to_string())
.map_err_context(|| translate!("install-error-create-dir-failed", "path" => path_to_create.as_path().quote()))
{
show!(e);
continue;

View file

@ -1013,7 +1013,7 @@ fn test_install_creating_leading_dir_fails_on_long_name() {
.arg(source)
.arg(at.plus(target.as_str()))
.fails()
.stderr_contains("failed to create");
.stderr_contains("cannot create directory");
}
#[test]