From 30dbdf7ac701722b7475cc8964dd888c9b9462cb Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sat, 8 Nov 2025 10:58:03 +0100 Subject: [PATCH] install: fix the error message should fix: tests/install/basic-1.sh --- src/uu/install/locales/en-US.ftl | 2 +- src/uu/install/src/install.rs | 2 +- tests/by-util/test_install.rs | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/uu/install/locales/en-US.ftl b/src/uu/install/locales/en-US.ftl index 4eeba9e37..344301666 100644 --- a/src/uu/install/locales/en-US.ftl +++ b/src/uu/install/locales/en-US.ftl @@ -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 } diff --git a/src/uu/install/src/install.rs b/src/uu/install/src/install.rs index c6cd184a9..4242cc04b 100644 --- a/src/uu/install/src/install.rs +++ b/src/uu/install/src/install.rs @@ -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; diff --git a/tests/by-util/test_install.rs b/tests/by-util/test_install.rs index e909a32e4..f4c7b2dc1 100644 --- a/tests/by-util/test_install.rs +++ b/tests/by-util/test_install.rs @@ -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]