2024-01-01 14:11:58 +00:00
#!/usr/bin/env bash
2022-02-06 23:23:02 +00:00
# `build-gnu.bash` ~ builds GNU coreutils (from supplied sources)
#
2021-05-31 02:57:20 +00:00
2024-03-16 15:54:03 +00:00
# spell-checker:ignore (paths) abmon deref discrim eacces getlimits getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW baddecode submodules xstrtol ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) gnproc greadlink gsed
2021-05-31 02:57:20 +00:00
2021-05-21 16:25:23 +00:00
set -e
2022-02-06 23:23:02 +00:00
2024-01-01 19:31:47 +00:00
# Use GNU version for make, nproc, readlink and sed on *BSD
case " $OSTYPE " in
*bsd*)
MAKE = "gmake"
NPROC = "gnproc"
READLINK = "greadlink"
SED = "gsed"
; ;
*)
MAKE = "make"
NPROC = "nproc"
READLINK = "readlink"
SED = "sed"
; ;
esac
2022-02-06 23:23:02 +00:00
ME = " ${ 0 } "
2024-01-01 19:31:47 +00:00
ME_dir = " $( dirname -- " $( " ${ READLINK } " -fm -- " ${ ME } " ) " ) "
2022-02-06 23:23:02 +00:00
REPO_main_dir = " $( dirname -- " ${ ME_dir } " ) "
2023-12-16 14:06:58 +00:00
# Default profile is 'debug'
UU_MAKE_PROFILE = 'debug'
for arg in " $@ "
do
if [ " $arg " = = "--release-build" ] ; then
UU_MAKE_PROFILE = 'release'
break
fi
done
echo " UU_MAKE_PROFILE=' ${ UU_MAKE_PROFILE } ' "
2022-02-12 17:14:02 +00:00
### * config (from environment with fallback defaults); note: GNU is expected to be a sibling repo directory
2022-02-06 23:23:02 +00:00
path_UUTILS = ${ path_UUTILS :- ${ REPO_main_dir } }
2024-01-01 19:31:47 +00:00
path_GNU = " $( " ${ READLINK } " -fm -- " ${ path_GNU :- ${ path_UUTILS } /../gnu } " ) "
2022-02-06 23:23:02 +00:00
###
2023-09-05 08:05:58 +00:00
# On MacOS there is no system /usr/bin/timeout
2023-09-04 16:23:49 +00:00
# and trying to add it to /usr/bin (with symlink of copy binary) will fail unless system integrity protection is disabled (not ideal)
# ref: https://support.apple.com/en-us/102149
# On MacOS the Homebrew coreutils could be installed and then "sudo ln -s /opt/homebrew/bin/timeout /usr/local/bin/timeout"
# Set to /usr/local/bin/timeout instead if /usr/bin/timeout is not found
SYSTEM_TIMEOUT = "timeout"
2023-09-05 08:05:58 +00:00
if [ -x /usr/bin/timeout ] ; then
2023-09-04 16:23:49 +00:00
SYSTEM_TIMEOUT = "/usr/bin/timeout"
2023-09-05 08:05:58 +00:00
elif [ -x /usr/local/bin/timeout ] ; then
SYSTEM_TIMEOUT = "/usr/local/bin/timeout"
2023-09-04 16:23:49 +00:00
fi
###
release_tag_GNU = "v9.4"
2022-02-06 23:23:02 +00:00
if test ! -d " ${ path_GNU } " ; then
2023-06-29 04:10:45 +00:00
echo " Could not find GNU coreutils (expected at ' ${ path_GNU } ') "
echo "Run the following to download into the expected path:"
2022-02-06 23:23:02 +00:00
echo " git clone --recurse-submodules https://github.com/coreutils/coreutils.git \" ${ path_GNU } \" "
2023-09-04 16:23:49 +00:00
echo " After downloading GNU coreutils to \" ${ path_GNU } \" run the following commands to checkout latest release tag "
echo " cd \" ${ path_GNU } \" "
echo "git fetch --all --tags"
echo " git checkout tags/ ${ release_tag_GNU } "
2021-05-21 16:25:23 +00:00
exit 1
fi
2022-02-06 23:23:02 +00:00
###
2023-06-29 04:10:45 +00:00
echo " ME=' ${ ME } ' "
echo " ME_dir=' ${ ME_dir } ' "
echo " REPO_main_dir=' ${ REPO_main_dir } ' "
echo " path_UUTILS=' ${ path_UUTILS } ' "
echo " path_GNU=' ${ path_GNU } ' "
###
2022-02-06 23:23:02 +00:00
UU_BUILD_DIR = " ${ path_UUTILS } /target/ ${ UU_MAKE_PROFILE } "
echo " UU_BUILD_DIR=' ${ UU_BUILD_DIR } ' "
cd " ${ path_UUTILS } " && echo " [ pwd:' ${ PWD } ' ] "
2023-07-24 19:30:23 +00:00
if [ " $( uname) " = = "Linux" ] ; then
2023-07-29 06:18:35 +00:00
# only set on linux
2023-07-24 19:30:23 +00:00
export SELINUX_ENABLED = 1
fi
2024-01-01 19:31:47 +00:00
" ${ MAKE } " PROFILE = " ${ UU_MAKE_PROFILE } "
2023-07-24 19:30:23 +00:00
2022-02-06 23:23:02 +00:00
cp " ${ UU_BUILD_DIR } /install " " ${ UU_BUILD_DIR } /ginstall " # The GNU tests rename this script before running, to avoid confusion with the make target
2021-05-21 16:25:23 +00:00
# Create *sum binaries
2022-02-12 17:47:12 +00:00
for sum in b2sum b3sum md5sum sha1sum sha224sum sha256sum sha384sum sha512sum; do
2022-02-06 23:23:02 +00:00
sum_path = " ${ UU_BUILD_DIR } / ${ sum } "
2024-03-12 13:56:27 +00:00
test -f " ${ sum_path } " || ( cd ${ UU_BUILD_DIR } && ln -s "hashsum" " ${ sum } " )
2021-05-21 16:25:23 +00:00
done
2024-03-12 13:56:27 +00:00
test -f " ${ UU_BUILD_DIR } /[ " || ( cd ${ UU_BUILD_DIR } && ln -s "test" "[" )
2022-02-06 23:23:02 +00:00
##
cd " ${ path_GNU } " && echo " [ pwd:' ${ PWD } ' ] "
2021-05-21 16:25:23 +00:00
# Any binaries that aren't built become `false` so their tests fail
2022-02-06 23:05:12 +00:00
for binary in $( ./build-aux/gen-lists-of-programs.sh --list-progs) ; do
2022-02-06 23:23:02 +00:00
bin_path = " ${ UU_BUILD_DIR } / ${ binary } "
2022-02-06 23:05:12 +00:00
test -f " ${ bin_path } " || {
echo " ' ${ binary } ' was not built with uutils, using the 'false' program "
2022-02-06 23:23:02 +00:00
cp " ${ UU_BUILD_DIR } /false " " ${ bin_path } "
2022-02-06 23:05:12 +00:00
}
2021-05-21 16:25:23 +00:00
done
2022-05-01 10:51:40 +00:00
if test -f gnu-built; then
echo "GNU build already found. Skip"
echo " 'rm -f $( pwd ) /gnu-built' to force the build "
echo "Note: the customization of the tests will still happen"
else
2023-04-21 14:53:15 +00:00
./bootstrap --skip-po
2023-12-31 12:07:47 +00:00
./configure --quiet --disable-gcc-warnings --disable-nls --disable-dependency-tracking --disable-bold-man-page-references
2022-05-01 10:51:40 +00:00
#Add timeout to to protect against hangs
2023-09-04 16:23:49 +00:00
sed -i 's|^"\$@|' " ${ SYSTEM_TIMEOUT } " ' 600 "\$@|' build-aux/test-driver
2022-05-01 10:51:40 +00:00
# Change the PATH in the Makefile to test the uutils coreutils instead of the GNU coreutils
sed -i " s/^[[:blank:]]*PATH=.*/ PATH=' ${ UU_BUILD_DIR // \/ / \\ / } \$(PATH_SEPARATOR)'\"\$\$PATH\" \\\/ " Makefile
sed -i 's| tr | /usr/bin/tr |' tests/init.sh
2023-12-24 15:37:43 +00:00
# Use a better diff
sed -i 's|diff -c|diff -u|g' tests/Coreutils.pm
2024-01-01 19:31:47 +00:00
" ${ MAKE } " -j " $( " ${ NPROC } " ) "
2022-05-01 10:51:40 +00:00
touch gnu-built
fi
2022-02-22 03:50:04 +00:00
# Handle generated factor tests
t_first = 00
t_max = 36
2022-02-22 03:52:52 +00:00
# t_max_release=20
# if test "${UU_MAKE_PROFILE}" != "debug"; then
# # Generate the factor tests, so they can be fixed
# # * reduced to 20 to decrease log size (down from 36 expected by GNU)
# # * only for 'release', skipped for 'debug' as redundant and too time consuming (causing timeout errors)
# seq=$(
# i=${t_first}
# while test "${i}" -le "${t_max_release}"; do
# printf '%02d ' $i
# i=$((i + 1))
# done
# )
# for i in ${seq}; do
2024-01-01 19:31:47 +00:00
# "${MAKE}" "tests/factor/t${i}.sh"
2022-02-22 03:52:52 +00:00
# done
# cat
# sed -i -e 's|^seq |/usr/bin/seq |' -e 's|sha1sum |/usr/bin/sha1sum |' tests/factor/t*.sh
# t_first=$((t_max_release + 1))
# fi
2022-02-16 16:16:42 +00:00
# strip all (debug) or just the longer (release) factor tests from Makefile
2022-02-22 03:50:04 +00:00
seq = $(
i = ${ t_first }
while test " ${ i } " -le " ${ t_max } " ; do
printf '%02d ' ${ i }
i = $(( i + 1 ))
done
)
for i in ${ seq } ; do
2022-02-16 16:16:42 +00:00
echo " strip t ${ i } .sh from Makefile "
2021-05-25 12:58:56 +00:00
sed -i -e " s/\$(tf)\/t ${ i } .sh//g " Makefile
done
2021-06-03 20:49:47 +00:00
grep -rl 'path_prepend_' tests/* | xargs sed -i 's| path_prepend_ ./src||'
2021-05-21 16:25:23 +00:00
# Remove tests checking for --version & --help
# Not really interesting for us and logs are too big
sed -i -e '/tests\/misc\/invalid-opt.pl/ D' \
2023-08-29 19:41:42 +00:00
-e '/tests\/help\/help-version.sh/ D' \
2023-08-30 08:30:36 +00:00
-e '/tests\/help\/help-version-getopt.sh/ D' \
2021-05-21 16:25:23 +00:00
Makefile
2021-05-24 20:32:48 +00:00
# logs are clotted because of this test
2023-08-29 19:41:42 +00:00
sed -i -e '/tests\/seq\/seq-precision.sh/ D' \
2021-05-24 20:32:48 +00:00
Makefile
2021-05-21 16:25:23 +00:00
# printf doesn't limit the values used in its arg, so this produced ~2GB of output
2023-08-29 19:41:42 +00:00
sed -i '/INT_OFLOW/ D' tests/printf/printf.sh
2021-05-21 16:25:23 +00:00
# Use the system coreutils where the test fails due to error in a util that is not the one being tested
2023-08-29 19:41:42 +00:00
sed -i 's|stat|/usr/bin/stat|' tests/touch/60-seconds.sh tests/sort/sort-compress-proc.sh
2022-03-07 03:36:26 +00:00
sed -i 's|ls -|/usr/bin/ls -|' tests/cp/same-file.sh tests/misc/mknod.sh tests/mv/part-symlink.sh
2023-08-29 19:41:42 +00:00
sed -i 's|chmod |/usr/bin/chmod |' tests/du/inacc-dir.sh tests/tail/tail-n0f.sh tests/cp/fail-perm.sh tests/mv/i-2.sh tests/shuf/shuf.sh
sed -i 's|sort |/usr/bin/sort |' tests/ls/hyperlink.sh tests/test/test-N.sh
sed -i 's|split |/usr/bin/split |' tests/factor/factor-parallel.sh
sed -i 's|id -|/usr/bin/id -|' tests/runcon/runcon-no-reorder.sh
2023-12-28 22:21:44 +00:00
sed -i "s|grep '^#define HAVE_CAP 1' \$CONFIG_HEADER > /dev/null|true|" tests/ls/capability.sh
2022-05-08 19:27:08 +00:00
# tests/ls/abmon-align.sh - https://github.com/uutils/coreutils/issues/3505
2023-08-29 19:41:42 +00:00
sed -i 's|touch |/usr/bin/touch |' tests/cp/reflink-perm.sh tests/ls/block-size.sh tests/mv/update.sh tests/ls/ls-time.sh tests/stat/stat-nanoseconds.sh tests/misc/time-style.sh tests/test/test-N.sh tests/ls/abmon-align.sh
2021-05-21 16:25:23 +00:00
sed -i 's|ln -|/usr/bin/ln -|' tests/cp/link-deref.sh
2024-01-01 23:13:20 +00:00
2024-01-04 23:03:12 +00:00
# our messages are better
sed -i "s|cannot stat 'symlink': Permission denied|not writing through dangling symlink 'symlink'|" tests/cp/fail-perm.sh
sed -i "s|cp: target directory 'symlink': Permission denied|cp: 'symlink' is not a directory|" tests/cp/fail-perm.sh
2024-01-03 23:41:54 +00:00
# Our message is a bit better
sed -i "s|cannot create regular file 'no-such/': Not a directory|'no-such/' is not a directory|" tests/mv/trailing-slash.sh
2021-05-21 16:25:23 +00:00
sed -i 's|cp |/usr/bin/cp |' tests/mv/hard-2.sh
2023-08-29 19:41:42 +00:00
sed -i 's|paste |/usr/bin/paste |' tests/od/od-endian.sh
2023-09-04 16:23:49 +00:00
sed -i 's|timeout |' " ${ SYSTEM_TIMEOUT } " ' |' tests/tail/follow-stdin.sh
2021-05-21 16:25:23 +00:00
2021-06-03 20:49:47 +00:00
# Add specific timeout to tests that currently hang to limit time spent waiting
2023-09-04 16:23:49 +00:00
sed -i 's|\(^\s*\)seq \$|\1' " ${ SYSTEM_TIMEOUT } " ' 0.1 seq \$|' tests/seq/seq-precision.sh tests/seq/seq-long-double.sh
2021-05-21 16:25:23 +00:00
2023-09-04 16:23:49 +00:00
# Remove dup of /usr/bin/ and /usr/local/bin/ when executed several times
2024-01-01 19:31:47 +00:00
grep -rlE '/usr/bin/\s?/usr/bin' init.cfg tests/* | xargs -r sed -Ei 's|/usr/bin/\s?/usr/bin/|/usr/bin/|g'
grep -rlE '/usr/local/bin/\s?/usr/local/bin' init.cfg tests/* | xargs -r sed -Ei 's|/usr/local/bin/\s?/usr/local/bin/|/usr/local/bin/|g'
2021-06-03 20:49:47 +00:00
2021-06-03 20:15:57 +00:00
#### Adjust tests to make them work with Rust/coreutils
# in some cases, what we are doing in rust/coreutils is good (or better)
# we should not regress our project just to match what GNU is going.
# So, do some changes on the fly
2024-03-14 18:38:28 +00:00
patch -N -r - -d " $path_GNU " -p 1 -i " `realpath \" $path_UUTILS /util/gnu-patches/tests_env_env-S.pl.patch\"` " || true
2021-06-03 20:15:57 +00:00
sed -i -e "s|rm: cannot remove 'e/slink'|rm: cannot remove 'e'|g" tests/rm/fail-eacces.sh
2023-10-22 08:47:17 +00:00
sed -i -e "s|rm: cannot remove 'a/b'|rm: cannot remove 'a'|g" tests/rm/fail-2eperm.sh
2021-06-03 21:07:51 +00:00
sed -i -e "s|rm: cannot remove 'a/b/file'|rm: cannot remove 'a'|g" tests/rm/cycle.sh
2021-06-03 21:30:33 +00:00
sed -i -e "s|rm: cannot remove directory 'b/a/p'|rm: cannot remove 'b'|g" tests/rm/rm1.sh
sed -i -e "s|rm: cannot remove 'a/1'|rm: cannot remove 'a'|g" tests/rm/rm2.sh
2021-06-04 21:55:24 +00:00
sed -i -e "s|removed directory 'a/'|removed directory 'a'|g" tests/rm/v-slash.sh
2023-05-01 06:40:07 +00:00
# 'rel' doesn't exist. Our implementation is giving a better message.
sed -i -e "s|rm: cannot remove 'rel': Permission denied|rm: cannot remove 'rel': No such file or directory|g" tests/rm/inaccessible.sh
2022-06-21 20:21:19 +00:00
# overlay-headers.sh test intends to check for inotify events,
# however there's a bug because `---dis` is an alias for: `---disable-inotify`
2023-08-29 19:41:42 +00:00
sed -i -e "s|---dis ||g" tests/tail/overlay-headers.sh
2022-06-21 20:21:19 +00:00
2024-01-01 23:42:52 +00:00
# Do not FAIL, just do a regular ERROR
sed -i -e "s|framework_failure_ 'no inotify_add_watch';|fail=1;|" tests/tail/inotify-rotate-resources.sh
2022-02-06 23:23:02 +00:00
test -f " ${ UU_BUILD_DIR } /getlimits " || cp src/getlimits " ${ UU_BUILD_DIR } "
2021-08-03 21:42:40 +00:00
2023-10-22 20:11:34 +00:00
# pr produces very long log and this command isn't super interesting
# SKIP for now
sed -i -e " s|my \$prog = 'pr'; $|my \$prog = 'pr';CuSkip::skip \"\$prog: SKIP for producing too long logs\";| " tests/pr/pr-tests.pl
2024-03-16 11:28:06 +00:00
# We don't have the same error message and no need to be that specific
sed -i -e "s|invalid suffix in --pages argument|invalid --pages argument|" \
-e "s|--pages argument '\$too_big' too large|invalid --pages argument '\$too_big'|" \
-e "s|invalid page range|invalid --pages argument|" tests/misc/xstrtol.pl
2021-08-03 21:42:40 +00:00
# When decoding an invalid base32/64 string, gnu writes everything it was able to decode until
# it hit the decode error, while we don't write anything if the input is invalid.
2021-08-02 22:24:04 +00:00
sed -i "s/\(baddecode.*OUT=>\"\).*\"/\1\"/g" tests/misc/base64.pl
2021-08-04 22:28:14 +00:00
sed -i "s/\(\(b2[ml]_[69]\|b32h_[56]\|z85_8\|z85_35\).*OUT=>\)[^}]*\(.*\)/\1\"\"\3/g" tests/misc/basenc.pl
# add "error: " to the expected error message
sed -i "s/\$prog: invalid input/\$prog: error: invalid input/g" tests/misc/basenc.pl
# basenc: swap out error message for unexpected arg
2022-10-13 18:42:01 +00:00
sed -i "s/ {ERR=>\"\$prog: foobar\\\\n\" \. \$try_help }/ {ERR=>\"error: Found argument '--foobar' which wasn't expected, or isn't valid in this context\n\n If you tried to supply '--foobar' as a value rather than a flag, use '-- --foobar'\n\nUsage: basenc [OPTION]... [FILE]\n\nFor more information try '--help'\n\"}]/" tests/misc/basenc.pl
2021-08-04 22:28:14 +00:00
sed -i "s/ {ERR_SUBST=>\"s\/(unrecognized|unknown) option \[-' \]\*foobar\[' \]\*\/foobar\/\"}],//" tests/misc/basenc.pl
2021-08-02 22:24:04 +00:00
# Remove the check whether a util was built. Otherwise tests against utils like "arch" are not run.
sed -i "s|require_built_ |# require_built_ |g" init.cfg
2022-09-20 20:29:30 +00:00
# Some tests are executed with the "nobody" user.
# The check to verify if it works is based on the GNU coreutils version
# making it too restrictive for us
sed -i "s|\$PACKAGE_VERSION|[0-9]*|g" tests/rm/fail-2eperm.sh tests/mv/sticky-to-xpart.sh init.cfg
2022-03-29 09:26:39 +00:00
2022-04-05 21:20:16 +00:00
# usage_vs_getopt.sh is heavily modified as it runs all the binaries
2022-03-29 09:26:39 +00:00
# with the option -/ is used, clap is returning a better error than GNU's. Adjust the GNU test
sed -i -e "s~ grep \" '\*/'\*\" err || framework_failure_~ grep \" '*-/'*\" err || framework_failure_~" tests/misc/usage_vs_getopt.sh
sed -i -e "s~ sed -n \"1s/'\\\/'/'OPT'/p\" < err >> pat || framework_failure_~ sed -n \"1s/'-\\\/'/'OPT'/p\" < err >> pat || framework_failure_~" tests/misc/usage_vs_getopt.sh
# Ignore some binaries (not built)
2022-03-29 18:19:05 +00:00
# And change the default error code to 2
2022-04-06 11:59:44 +00:00
# see issue #3331 (clap limitation).
# Upstream returns 1 for most of the program. We do for cp, truncate & pr
# So, keep it as it
2022-04-15 15:30:40 +00:00
sed -i -e " s/rcexp=1 $/rcexp=2\n case \"\$prg\" in chcon|runcon) return;; esac/ " -e "s/rcexp=125 ;;/rcexp=2 ;;\ncp|truncate|pr) rcexp=1;;/" tests/misc/usage_vs_getopt.sh
2022-04-05 21:20:16 +00:00
# GNU has option=[SUFFIX], clap is <SUFFIX>
sed -i -e " s/cat opts/sed -i -e \"s| <.\*> $||g\" opts/ " tests/misc/usage_vs_getopt.sh
# for some reasons, some stuff are duplicated, strip that
sed -i -e "s/provoked error./provoked error\ncat pat |sort -u > pat/" tests/misc/usage_vs_getopt.sh
2022-03-29 22:11:27 +00:00
# Update the GNU error message to match ours
2022-07-18 20:53:05 +00:00
sed -i -e "s/link-to-dir: hard link not allowed for directory/failed to create hard link 'link-to-dir' =>/" -e "s|link-to-dir/: hard link not allowed for directory|failed to create hard link 'link-to-dir/' =>|" tests/ln/hard-to-sym.sh
2022-06-13 20:44:49 +00:00
2022-06-15 12:33:19 +00:00
# GNU sleep accepts some crazy string, not sure we should match this behavior
2022-06-13 20:44:49 +00:00
sed -i -e "s/timeout 10 sleep 0x.002p1/#timeout 10 sleep 0x.002p1/" tests/misc/sleep.sh
2022-06-18 20:37:09 +00:00
# install verbose messages shows ginstall as command
sed -i -e "s/ginstall: creating directory/install: creating directory/g" tests/install/basic-1.sh
2022-08-05 09:17:36 +00:00
# GNU doesn't support padding < -LONG_MAX
2022-08-05 12:01:58 +00:00
# disable this test case
2024-01-01 19:31:47 +00:00
# Use GNU sed because option -z is not available on BSD sed
" ${ SED } " -i -Ez "s/\n([^\n#]*pad-3\.2[^\n]*)\n([^\n]*)\n([^\n]*)/\n# uutils\/numfmt supports padding = LONG_MIN\n#\1\n#\2\n#\3/" tests/misc/numfmt.pl
2022-08-05 09:17:36 +00:00
2022-11-02 09:20:04 +00:00
# Update the GNU error message to match the one generated by clap
sed -i -e "s/\$prog: multiple field specifications/error: The argument '--field <FIELDS>' was provided more than once, but cannot be used multiple times\n\nUsage: numfmt [OPTION]... [NUMBER]...\n\n\nFor more information try '--help'/g" tests/misc/numfmt.pl
2023-04-29 07:48:05 +00:00
sed -i -e "s/Try 'mv --help' for more information/For more information, try '--help'/g" -e "s/mv: missing file operand/error: the following required arguments were not provided:\n <files>...\n\nUsage: mv [OPTION]... [-T] SOURCE DEST\n mv [OPTION]... SOURCE... DIRECTORY\n mv [OPTION]... -t DIRECTORY SOURCE...\n/g" -e "s/mv: missing destination file operand after 'no-file'/error: The argument '<files>...' requires at least 2 values, but only 1 was provided\n\nUsage: mv [OPTION]... [-T] SOURCE DEST\n mv [OPTION]... SOURCE... DIRECTORY\n mv [OPTION]... -t DIRECTORY SOURCE...\n/g" tests/mv/diag.sh
2022-11-02 09:20:04 +00:00
2023-12-20 22:09:15 +00:00
# our error message is better
sed -i -e "s|mv: cannot overwrite 'a/t': Directory not empty|mv: cannot move 'b/t' to 'a/t': Directory not empty|" tests/mv/dir2dir.sh
2022-08-05 09:17:36 +00:00
# GNU doesn't support width > INT_MAX
2022-08-05 12:01:58 +00:00
# disable these test cases
2023-08-29 19:41:42 +00:00
sed -i -E " s|^([^#]*2_31.*) $|#\1|g " tests/printf/printf-cov.pl
2023-03-27 17:57:35 +00:00
sed -i -e "s/du: invalid -t argument/du: invalid --threshold argument/" -e "s/du: option requires an argument/error: a value is required for '--threshold <SIZE>' but none was supplied/" -e "/Try 'du --help' for more information./d" tests/du/threshold.sh
2023-06-19 20:32:49 +00:00
2023-12-26 13:40:31 +00:00
# Remove the extra output check
sed -i -e "s|Try '\$prog --help' for more information.\\\n||" tests/du/files0-from.pl
sed -i -e "s|when reading file names from stdin, no file name of\"|-: No such file or directory\n\"|" -e "s| '-' allowed\\\n||" tests/du/files0-from.pl
2024-03-16 09:06:24 +00:00
sed -i -e "s|-: No such file or directory|cannot access '-': No such file or directory|g" tests/du/files0-from.pl
2023-12-26 13:40:31 +00:00
2023-10-24 21:56:00 +00:00
awk 'BEGIN {count=0} /compare exp out2/ && count < 6 {sub(/compare exp out2/, "grep -q \"cannot be used with\" out2"); count++} 1' tests/df/df-output.sh > tests/df/df-output.sh.tmp && mv tests/df/df-output.sh.tmp tests/df/df-output.sh
2023-09-22 20:12:44 +00:00
# with ls --dired, in case of error, we have a slightly different error position
sed -i -e "s|44 45|48 49|" tests/ls/stat-failed.sh
2023-10-22 19:26:11 +00:00
# small difference in the error message
2024-01-01 19:31:47 +00:00
# Use GNU sed for /c command
" ${ SED } " -i -e " /ls: invalid argument 'XX' for 'time style'/,/Try 'ls --help' for more information\./c\
2023-10-22 19:26:11 +00:00
ls: invalid --time-style argument 'XX' \n Possible values are: [ \" full-iso\" , \" long-iso\" , \" iso\" , \" locale\" , \" +FORMAT ( e.g., +%H:%M) for a 'date' -style format\" ] \n \n For more information try --help" tests/ls/time-style-diag.sh
2023-06-19 20:32:49 +00:00
# disable two kind of tests:
# "hostid BEFORE --help" doesn't fail for GNU. we fail. we are probably doing better
# "hostid BEFORE --help AFTER " same for this
2023-08-29 19:41:42 +00:00
sed -i -e "s/env \$prog \$BEFORE \$opt > out2/env \$prog \$BEFORE \$opt > out2 #/" -e "s/env \$prog \$BEFORE \$opt AFTER > out3/env \$prog \$BEFORE \$opt AFTER > out3 #/" -e "s/compare exp out2/compare exp out2 #/" -e "s/compare exp out3/compare exp out3 #/" tests/help/help-version-getopt.sh
2023-12-17 09:02:16 +00:00
2024-03-12 13:56:27 +00:00
# The case doesn't really matter here
sed -i -e "s|WARNING: 1 line is improperly formatted|warning: 1 line is improperly formatted|" tests/cksum/md5sum-bsd.sh
2023-12-17 09:02:16 +00:00
# Add debug info + we have less syscall then GNU's. Adjust our check.
2024-01-01 19:31:47 +00:00
# Use GNU sed for /c command
" ${ SED } " -i -e ' /test \$ n_stat1 = \$ n_stat2 \\ /c\
2023-12-17 09:02:16 +00:00
echo "n_stat1 = \$n_stat1" \n \
echo "n_stat2 = \$n_stat2" \n \
test \$ n_stat1 -ge \$ n_stat2 \\ ' tests/ls/stat-free-color.sh