From e5da3ee6f85dd326b2f78391be0d6e40ee3d26d2 Mon Sep 17 00:00:00 2001 From: Sylvestre Ledru Date: Sun, 12 Jan 2025 23:31:05 +0100 Subject: [PATCH] gnu patches: move to use quilt --- .github/workflows/GnuTests.yml | 2 +- util/build-gnu.sh | 6 ++++- util/gnu-patches/debug-stat-nano.patch | 26 ++++--------------- util/gnu-patches/tests_cksum_base64.patch | 8 +++--- util/gnu-patches/tests_comm.pl.patch | 8 +++--- util/gnu-patches/tests_cut_error_msg.patch | 8 +++--- util/gnu-patches/tests_dup_source.patch | 10 +++---- util/gnu-patches/tests_env_env-S.pl.patch | 8 +++--- util/gnu-patches/tests_factor_factor.pl.patch | 24 ++++++----------- util/gnu-patches/tests_invalid_opt.patch | 8 +++--- util/gnu-patches/tests_ls_no_cap.patch | 14 +++++----- util/gnu-patches/tests_sort_merge.pl.patch | 8 +++--- util/gnu-patches/tests_tsort.patch | 8 +++--- 13 files changed, 58 insertions(+), 80 deletions(-) diff --git a/.github/workflows/GnuTests.yml b/.github/workflows/GnuTests.yml index 0b9d8ce7fe4..53c7bcb028f 100644 --- a/.github/workflows/GnuTests.yml +++ b/.github/workflows/GnuTests.yml @@ -105,7 +105,7 @@ jobs: run: | ## Install dependencies sudo apt-get update - sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr + sudo apt-get install -y autoconf autopoint bison texinfo gperf gcc g++ gdb python3-pyinotify jq valgrind libexpect-perl libacl1-dev libattr1-dev libcap-dev libselinux1-dev attr quilt - name: Add various locales shell: bash run: | diff --git a/util/build-gnu.sh b/util/build-gnu.sh index d29283a69b1..592439bb143 100755 --- a/util/build-gnu.sh +++ b/util/build-gnu.sh @@ -219,7 +219,11 @@ grep -rlE '/usr/local/bin/\s?/usr/local/bin' init.cfg tests/* | xargs -r sed -Ei # we should not regress our project just to match what GNU is going. # So, do some changes on the fly -eval cat "$path_UUTILS/util/gnu-patches/*.patch" | patch -N -r - -d "$path_GNU" -p 1 -i - || true +# Set up quilt for patch management +export QUILT_PATCHES="$path_UUTILS/util/gnu-patches" +cd "$path_GNU" +quilt push +#eval cat "$path_UUTILS/util/gnu-patches/*.patch" | patch -N -r - -d "$path_GNU" -p 1 -i - sed -i -e "s|rm: cannot remove 'e/slink'|rm: cannot remove 'e'|g" tests/rm/fail-eacces.sh diff --git a/util/gnu-patches/debug-stat-nano.patch b/util/gnu-patches/debug-stat-nano.patch index 5e1b2f6741b..5c1629e0723 100644 --- a/util/gnu-patches/debug-stat-nano.patch +++ b/util/gnu-patches/debug-stat-nano.patch @@ -1,7 +1,7 @@ -diff --git a/tests/stat/stat-nanoseconds.sh b/tests/stat/stat-nanoseconds.sh -index a4f55cf6d..53855576d 100755 ---- a/tests/stat/stat-nanoseconds.sh -+++ b/tests/stat/stat-nanoseconds.sh +Index: gnu/tests/stat/stat-nanoseconds.sh +=================================================================== +--- gnu.orig/tests/stat/stat-nanoseconds.sh ++++ gnu/tests/stat/stat-nanoseconds.sh @@ -1,6 +1,6 @@ #!/bin/sh # Exercise format strings involving %:X, %:Y, etc. @@ -10,23 +10,7 @@ index a4f55cf6d..53855576d 100755 # Copyright (C) 2010-2024 Free Software Foundation, Inc. # This program is free software: you can redistribute it and/or modify -@@ -16,7 +16,7 @@ - # You should have received a copy of the GNU General Public License - # along with this program. If not, see . - --. "${srcdir=.}/tests/init.sh"; path_prepend_ ./src -+. "${srcdir=.}/tests/init.sh"; - print_ver_ stat - - # Set this to avoid problems with weird time zones. -@@ -24,23 +24,35 @@ TZ=UTC0 - export TZ - - # Use a timestamp near the Epoch to avoid trouble with leap seconds. --touch -d '1970-01-01 18:43:33.023456789' k || framework_failure_ -+/usr/bin/touch -d '1970-01-01 18:43:33.023456789' k || framework_failure_ - - ls --full-time | grep 18:43:33.023456789 \ +@@ -30,17 +30,29 @@ ls --full-time | grep 18:43:33.023456789 || skip_ this file system does not support sub-second timestamps test "$(stat -c %Y k)" = 67413 || fail=1 diff --git a/util/gnu-patches/tests_cksum_base64.patch b/util/gnu-patches/tests_cksum_base64.patch index 2a8ed0af40e..22fa683362e 100644 --- a/util/gnu-patches/tests_cksum_base64.patch +++ b/util/gnu-patches/tests_cksum_base64.patch @@ -1,7 +1,7 @@ -diff --git a/tests/cksum/cksum-base64.pl b/tests/cksum/cksum-base64.pl -index a037a1628..c6d87d447 100755 ---- a/tests/cksum/cksum-base64.pl -+++ b/tests/cksum/cksum-base64.pl +Index: gnu/tests/cksum/cksum-base64.pl +=================================================================== +--- gnu.orig/tests/cksum/cksum-base64.pl ++++ gnu/tests/cksum/cksum-base64.pl @@ -91,8 +91,8 @@ my $prog = 'cksum'; my $fail = run_tests ($program_name, $prog, \@Tests, $save_temps, $verbose); diff --git a/util/gnu-patches/tests_comm.pl.patch b/util/gnu-patches/tests_comm.pl.patch index d3d5595a2c5..602071f483a 100644 --- a/util/gnu-patches/tests_comm.pl.patch +++ b/util/gnu-patches/tests_comm.pl.patch @@ -1,7 +1,7 @@ -diff --git a/tests/misc/comm.pl b/tests/misc/comm.pl -index 5bd5f56d7..8322d92ba 100755 ---- a/tests/misc/comm.pl -+++ b/tests/misc/comm.pl +Index: gnu/tests/misc/comm.pl +=================================================================== +--- gnu.orig/tests/misc/comm.pl ++++ gnu/tests/misc/comm.pl @@ -73,18 +73,24 @@ my @Tests = # invalid missing command line argument (1) diff --git a/util/gnu-patches/tests_cut_error_msg.patch b/util/gnu-patches/tests_cut_error_msg.patch index 3f57d204813..1b1673fef72 100644 --- a/util/gnu-patches/tests_cut_error_msg.patch +++ b/util/gnu-patches/tests_cut_error_msg.patch @@ -1,7 +1,7 @@ -diff --git a/tests/cut/cut.pl b/tests/cut/cut.pl -index 1670db02e..ed633792a 100755 ---- a/tests/cut/cut.pl -+++ b/tests/cut/cut.pl +Index: gnu/tests/cut/cut.pl +=================================================================== +--- gnu.orig/tests/cut/cut.pl ++++ gnu/tests/cut/cut.pl @@ -29,13 +29,15 @@ my $mb_locale = $ENV{LOCALE_FR_UTF8}; my $prog = 'cut'; diff --git a/util/gnu-patches/tests_dup_source.patch b/util/gnu-patches/tests_dup_source.patch index 44e33723bc1..4c24498253d 100644 --- a/util/gnu-patches/tests_dup_source.patch +++ b/util/gnu-patches/tests_dup_source.patch @@ -1,8 +1,8 @@ -diff --git a/tests/mv/dup-source.sh b/tests/mv/dup-source.sh -index 7bcd82fc3..0f9005296 100755 ---- a/tests/mv/dup-source.sh -+++ b/tests/mv/dup-source.sh -@@ -83,7 +83,7 @@ $i: cannot stat 'a': No such file or directory +Index: gnu/tests/mv/dup-source.sh +=================================================================== +--- gnu.orig/tests/mv/dup-source.sh ++++ gnu/tests/mv/dup-source.sh +@@ -83,7 +83,7 @@ $i: cannot stat 'a': No such file or dir $i: cannot stat 'a': No such file or directory $i: cannot stat 'b': No such file or directory $i: cannot move './b' to a subdirectory of itself, 'b/b' diff --git a/util/gnu-patches/tests_env_env-S.pl.patch b/util/gnu-patches/tests_env_env-S.pl.patch index 404a00ca60e..4a1ae939a6b 100644 --- a/util/gnu-patches/tests_env_env-S.pl.patch +++ b/util/gnu-patches/tests_env_env-S.pl.patch @@ -1,7 +1,7 @@ -diff --git a/tests/env/env-S.pl b/tests/env/env-S.pl -index 710ca82cf..af7cf6efa 100755 ---- a/tests/env/env-S.pl -+++ b/tests/env/env-S.pl +Index: gnu/tests/env/env-S.pl +=================================================================== +--- gnu.orig/tests/env/env-S.pl ++++ gnu/tests/env/env-S.pl @@ -209,27 +209,28 @@ my @Tests = {ERR=>"$prog: no terminating quote in -S string\n"}], ['err5', q[-S'A=B\\q'], {EXIT=>125}, diff --git a/util/gnu-patches/tests_factor_factor.pl.patch b/util/gnu-patches/tests_factor_factor.pl.patch index 731abcc9117..99ebd616978 100644 --- a/util/gnu-patches/tests_factor_factor.pl.patch +++ b/util/gnu-patches/tests_factor_factor.pl.patch @@ -1,22 +1,14 @@ -diff --git a/tests/factor/factor.pl b/tests/factor/factor.pl -index b1406c266..3d97cd6a5 100755 ---- a/tests/factor/factor.pl -+++ b/tests/factor/factor.pl -@@ -61,12 +61,14 @@ my @Tests = - # Map newer glibc diagnostic to expected. - # Also map OpenBSD 5.1's "unknown option" to expected "invalid option". +Index: gnu/tests/factor/factor.pl +=================================================================== +--- gnu.orig/tests/factor/factor.pl ++++ gnu/tests/factor/factor.pl +@@ -63,7 +63,8 @@ my @Tests = {ERR_SUBST => q!s/'1'/1/;s/unknown/invalid/!}, -- {ERR => "$prog: invalid option -- 1\n" -- . "Try '$prog --help' for more information.\n"}, -+ {ERR => "error: unexpected argument '-1' found\n\n" -+ . " tip: to pass '-1' as a value, use '-- -1'\n\n" + {ERR => "error: unexpected argument '-1' found\n\n" + . " tip: to pass '-1' as a value, use '-- -1'\n\n" +- . "Usage: factor [OPTION]... [NUMBER]...\n"}, + . "Usage: factor [OPTION]... [NUMBER]...\n\n" + . "For more information, try '--help'.\n"}, {EXIT => 1}], ['cont', 'a 4', {OUT => "4: 2 2\n"}, -- {ERR => "$prog: 'a' is not a valid positive integer\n"}, -+ {ERR => "$prog: warning: a: invalid digit found in string\n"}, - {EXIT => 1}], - ['bug-2012-a', '465658903', {OUT => '15259 30517'}], - ['bug-2012-b', '2242724851', {OUT => '33487 66973'}], diff --git a/util/gnu-patches/tests_invalid_opt.patch b/util/gnu-patches/tests_invalid_opt.patch index 1c70bc8c92a..c23476674e7 100644 --- a/util/gnu-patches/tests_invalid_opt.patch +++ b/util/gnu-patches/tests_invalid_opt.patch @@ -1,7 +1,7 @@ -diff --git a/tests/misc/invalid-opt.pl b/tests/misc/invalid-opt.pl -index 4b9c4c184..4ccd89482 100755 ---- a/tests/misc/invalid-opt.pl -+++ b/tests/misc/invalid-opt.pl +Index: gnu/tests/misc/invalid-opt.pl +=================================================================== +--- gnu.orig/tests/misc/invalid-opt.pl ++++ gnu/tests/misc/invalid-opt.pl @@ -74,23 +74,13 @@ foreach my $prog (@built_programs) defined $out or $out = ''; diff --git a/util/gnu-patches/tests_ls_no_cap.patch b/util/gnu-patches/tests_ls_no_cap.patch index 5944e3f5661..a17f00ef6a3 100644 --- a/util/gnu-patches/tests_ls_no_cap.patch +++ b/util/gnu-patches/tests_ls_no_cap.patch @@ -1,9 +1,9 @@ -diff --git a/tests/ls/no-cap.sh b/tests/ls/no-cap.sh -index 3d84c74ff..d1f60e70a 100755 ---- a/tests/ls/no-cap.sh -+++ b/tests/ls/no-cap.sh -@@ -21,13 +21,13 @@ print_ver_ ls - require_strace_ capget +Index: gnu/tests/ls/no-cap.sh +=================================================================== +--- gnu.orig/tests/ls/no-cap.sh ++++ gnu/tests/ls/no-cap.sh +@@ -27,11 +27,11 @@ setcap 'cap_net_bind_service=ep' file || + skip_ "setcap doesn't work" LS_COLORS=ca=1; export LS_COLORS -strace -e capget ls --color=always > /dev/null 2> out || fail=1 @@ -11,8 +11,6 @@ index 3d84c74ff..d1f60e70a 100755 +strace -e llistxattr ls --color=always > /dev/null 2> out || fail=1 +$EGREP 'llistxattr\(' out || skip_ "your ls doesn't call llistxattr" - rm -f out - LS_COLORS=ca=:; export LS_COLORS -strace -e capget ls --color=always > /dev/null 2> out || fail=1 -$EGREP 'capget\(' out && fail=1 diff --git a/util/gnu-patches/tests_sort_merge.pl.patch b/util/gnu-patches/tests_sort_merge.pl.patch index a19677a6d0a..d6db2e09c60 100644 --- a/util/gnu-patches/tests_sort_merge.pl.patch +++ b/util/gnu-patches/tests_sort_merge.pl.patch @@ -1,7 +1,7 @@ -diff --git a/tests/sort/sort-merge.pl b/tests/sort/sort-merge.pl -index 89eed0c64..c2f5aa7e5 100755 ---- a/tests/sort/sort-merge.pl -+++ b/tests/sort/sort-merge.pl +Index: gnu/tests/sort/sort-merge.pl +=================================================================== +--- gnu.orig/tests/sort/sort-merge.pl ++++ gnu/tests/sort/sort-merge.pl @@ -43,22 +43,22 @@ my @Tests = # check validation of --batch-size option ['nmerge-0', "-m --batch-size=0", @inputs, diff --git a/util/gnu-patches/tests_tsort.patch b/util/gnu-patches/tests_tsort.patch index 40c612c288f..1084f97043a 100644 --- a/util/gnu-patches/tests_tsort.patch +++ b/util/gnu-patches/tests_tsort.patch @@ -1,7 +1,7 @@ -diff --git a/tests/misc/tsort.pl b/tests/misc/tsort.pl -index 70bdc474c..4fd420a4e 100755 ---- a/tests/misc/tsort.pl -+++ b/tests/misc/tsort.pl +Index: gnu/tests/misc/tsort.pl +=================================================================== +--- gnu.orig/tests/misc/tsort.pl ++++ gnu/tests/misc/tsort.pl @@ -54,8 +54,10 @@ my @Tests = ['only-one', {IN => {f => ""}}, {IN => {g => ""}},