coreutils: Fix 2>/dev/full aborts & drop a sed for GnuTests (#10740)

This commit is contained in:
oech3
2026-03-07 17:56:35 +09:00
committed by GitHub
parent b47076eade
commit 5e24462b26
2 changed files with 8 additions and 4 deletions
+8 -2
View File
@@ -6,6 +6,7 @@
// spell-checker:ignore prefixcat testcat
use std::ffi::{OsStr, OsString};
use std::io::{Write, stderr};
use std::path::{Path, PathBuf};
use std::process;
@@ -25,13 +26,18 @@ pub fn get_all_utilities<T: Args>(
/// Prints a "utility not found" error and exits
pub fn not_found(util: &OsStr) -> ! {
eprintln!("{}: function/utility not found", util.maybe_quote());
let _ = writeln!(
stderr(),
"coreutils: unknown program '{}'",
util.maybe_quote()
);
process::exit(1);
}
/// Prints an "unrecognized option" error and exits
pub fn unrecognized_option(binary_name: &str, option: &OsStr) -> ! {
eprintln!(
let _ = writeln!(
stderr(),
"{binary_name}: unrecognized option '{}'",
option.to_string_lossy()
);
-2
View File
@@ -184,8 +184,6 @@ sed -i 's/^print_ver_.*/require_selinux_/' tests/chcon/chcon-fail.sh
# We use coreutils yes
sed -i "s|--coreutils-prog=||g" tests/misc/coreutils.sh
# Different message
sed -i "s|coreutils: unknown program 'blah'|blah: function/utility not found|" tests/misc/coreutils.sh
# Use the system coreutils where the test fails due to error in a util that is not the one being tested
sed -i "s|grep '^#define HAVE_CAP 1' \$CONFIG_HEADER > /dev/null|true|" tests/ls/capability.sh