Skip to content
Merged
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
6 changes: 1 addition & 5 deletions util/build-gnu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

# spell-checker:ignore (paths) abmon deref discrim eacces getopt ginstall inacc infloop inotify reflink ; (misc) INT_OFLOW OFLOW
# spell-checker:ignore baddecode submodules xstrtol distros ; (vars/env) SRCDIR vdir rcexp xpart dired OSTYPE ; (utils) greadlink gsed multihardlink texinfo CARGOFLAGS
# spell-checker:ignore openat TOCTOU CFLAGS tmpfs gnproc
# spell-checker:ignore openat TOCTOU CFLAGS tmpfs gnproc autoreconf

set -e

Expand Down Expand Up @@ -291,10 +291,6 @@ sed -i "s|# Independent of whether SELinux|return 0\n #|g" init.cfg
# 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

# usage_vs_refs.sh checks that all options appear in GNU's texi docs.
# we have some extra options
sed -i '1s/^/Exit 77\n/' tests/misc/usage_vs_refs.sh

# usage_vs_getopt.sh is heavily modified as it runs all the binaries
# 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
Expand Down
2 changes: 2 additions & 0 deletions util/gnu-patches/series
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,5 @@ test_mkdir_restorecon.patch
error_msg_uniq.diff
tests_numfmt.patch
tests_pwd-long.patch
tests_getopt_vs_usage.patch

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.

Is it intentional that only one of the two patches is listed here?

tests_usage_vs_refs.patch
18 changes: 18 additions & 0 deletions util/gnu-patches/tests_getopt_vs_usage.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Skip getopt_vs_usage.sh: it takes the option tables from GNU's own src/*.c and
greps our --help for each entry. There is little value in that here - every
option is covered individually by our own tests, and our --help is worded and
laid out differently from GNU's anyway.

Index: gnu/tests/misc/getopt_vs_usage.sh
===================================================================
--- gnu.orig/tests/misc/getopt_vs_usage.sh
+++ gnu/tests/misc/getopt_vs_usage.sh
@@ -18,6 +18,8 @@

. "${srcdir=.}/tests/init.sh";

+skip_ 'options are covered individually by our own tests'
+
getopts() {
sed -n '/long_*opt.*\[/,/^}/{/^ *{/p}' "$abs_top_srcdir/src/$1.c" |
grep -Ev "(\"-|Deprecated|Obsolescent|Not in $1)"
18 changes: 18 additions & 0 deletions util/gnu-patches/tests_usage_vs_refs.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
Skip usage_vs_refs.sh: it cross-checks every option printed by --help against
references in GNU's doc/coreutils.texi. That manual is not part of this
implementation, so the test can only ever report our own options (-V, uptime
--pretty, hostname --fqdn, ...) as undocumented.

Index: gnu/tests/misc/usage_vs_refs.sh
===================================================================
--- gnu.orig/tests/misc/usage_vs_refs.sh
+++ gnu/tests/misc/usage_vs_refs.sh
@@ -18,6 +18,8 @@

. "${srcdir=.}/tests/init.sh";

+skip_ 'options are documented outside doc/coreutils.texi'
+

getopts() {
skip='--help|--version' # These refs treated specially
Loading