Dennis Clarke wrote: > bash-5.1$ echo $CONFIG_SHELL > /usr/pkg/bin/bash > bash-5.1$ > > Guess what ? > > ============================================================================ > Testsuite summary for GNU patch 2.7.6 > ============================================================================ > # TOTAL: 44 > # PASS: 42 > # SKIP: 0 > # XFAIL: 2 > # FAIL: 0 > # XPASS: 0 > # ERROR: 0 > ============================================================================ > > Gotta love the need for GNU bash for this to work. Makes no sense at all > for "patch".
Interesting. I came up with a workaround, by modifying test-lib.sh, and it is in fact already committed in git: https://git.savannah.gnu.org/gitweb/?p=patch.git;a=commitdiff;h=7623b2dc0d1837ecfd58f32efc78e35834deeb38 But for me, then I get a test failure, see attached log file. The error messages "shift: can't shift that many" and "test: ==: unexpected operator" indicate another shell problem. Bruno
=========================================== GNU patch 2.7.6: tests/test-suite.log =========================================== # TOTAL: 44 # PASS: 41 # SKIP: 0 # XFAIL: 2 # FAIL: 1 # XPASS: 0 # ERROR: 0 .. contents:: :depth: 2 XFAIL: context-format ===================== * patch < ab.diff -- FAILED --- expected +++ got @@ -1 +1 @@ -patching file a +/home/bruno/patch-2.7.6/src/patch: **** replacement text or line numbers mangled in hunk at line 4 * patch < ab.diff -- FAILED --- expected +++ got @@ -1 +1 @@ -patching file a +/home/bruno/patch-2.7.6/src/patch: **** replacement text or line numbers mangled in hunk at line 4 2 tests (0 passed, 2 failed) XFAIL context-format (exit status: 1) XFAIL: dash-o-append ==================== * patch -o a.new a < a.diff -- FAILED --- expected +++ got @@ -1,2 +1,4 @@ patching file a.new (read from a) patching file a.new (read from a) +Hunk #1 FAILED at 1. +1 out of 1 hunk FAILED -- saving rejects to file a.new.rej * cat a.new -- FAILED --- expected +++ got @@ -1,2 +1,2 @@ two -three +one 2 tests (0 passed, 2 failed) XFAIL dash-o-append (exit status: 1) FAIL: merge =========== * x 3 -- FAILED --- expected +++ got @@ -1,7 +1 @@ -1 -2 -3 - -1 -2 -3 +shift: can't shift that many * x 3 2d -- FAILED --- expected +++ got @@ -1,5 +1 @@ -1 -3 - -1 -3 +shift: can't shift that many * x 2 2i\\ b -- FAILED --- expected +++ got @@ -1,7 +1 @@ -1 -b -2 - -1 -b -2 +shift: can't shift that many * x 3 2i\\ b -- 3i\\ c -- FAILED --- expected +++ got @@ -4,6 +4,8 @@ 2 c 3 +test: ==: unexpected operator +Status: 0 Hunk #1 merged at 2. 1 @@ -11,3 +13,5 @@ 2 c 3 +test: ==: unexpected operator +Status: 0 * x 3 2c\\ 2b -- 2c\\ 2c -- FAILED --- expected +++ got @@ -6,6 +6,7 @@ 2b >>>>>>> 3 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-8. @@ -18,4 +19,5 @@ 2b >>>>>>> 3 +test: ==: unexpected operator Status: 1 * x 3 2d -- 2d -- FAILED --- expected +++ got @@ -1,7 +1,11 @@ Hunk #1 already applied at 2. 1 3 +test: ==: unexpected operator +Status: 0 Hunk #1 already applied at 2. 1 3 +test: ==: unexpected operator +Status: 0 * x 2 2i\\ bc -- 2i\\ bc -- FAILED --- expected +++ got @@ -2,8 +2,12 @@ 1 bc 2 +test: ==: unexpected operator +Status: 0 Hunk #1 already applied at 2. 1 bc 2 +test: ==: unexpected operator +Status: 0 * x 4 2a\\ a 2a\\ a -- 2a\\ a 2a\\ a -- FAILED --- expected +++ got @@ -5,6 +5,8 @@ a 3 4 +test: ==: unexpected operator +Status: 0 Hunk #1 already applied at 3-4. 1 @@ -13,3 +15,5 @@ a 3 4 +test: ==: unexpected operator +Status: 0 * x 2 1i\\ a 1i\\ b -- 1i\\ a 1i\\ b -- FAILED --- expected +++ got @@ -3,9 +3,13 @@ b 1 2 +test: ==: unexpected operator +Status: 0 Hunk #1 already applied at 1-2. a b 1 2 +test: ==: unexpected operator +Status: 0 * x 2 2a\\ a 2a\\ b -- 2a\\ a 2a\\ b -- FAILED --- expected +++ got @@ -3,9 +3,13 @@ 2 a b +test: ==: unexpected operator +Status: 0 Hunk #1 already applied at 3-4. 1 2 a b +test: ==: unexpected operator +Status: 0 * x 4 2d -- 3d -- FAILED --- expected +++ got @@ -6,6 +6,7 @@ 3 >>>>>>> 4 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-9. @@ -19,4 +20,5 @@ 3 >>>>>>> 4 +test: ==: unexpected operator Status: 1 * x 4 3d -- 2d -- FAILED --- expected +++ got @@ -6,6 +6,7 @@ 2 >>>>>>> 4 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-9. @@ -19,4 +20,5 @@ 2 >>>>>>> 4 +test: ==: unexpected operator Status: 1 * x 3 3i\\ b -- 2d -- FAILED --- expected +++ got @@ -6,6 +6,7 @@ b >>>>>>> 3 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-8. @@ -18,4 +19,5 @@ b >>>>>>> 3 +test: ==: unexpected operator Status: 1 * x 3 2d -- 3i\\ b -- FAILED --- expected +++ got @@ -6,6 +6,7 @@ ======= >>>>>>> 3 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-8. @@ -18,4 +19,5 @@ ======= >>>>>>> 3 +test: ==: unexpected operator Status: 1 * x 1 1c\\ b -- 1c\\ c -- FAILED --- expected +++ got @@ -4,6 +4,7 @@ b >>>>>>> c +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 1-6. @@ -14,4 +15,5 @@ b >>>>>>> c +test: ==: unexpected operator Status: 1 * x 4 2c\\ a 3c\\ b -- 2c\\ a 3c\\ c -- FAILED --- expected +++ got @@ -7,6 +7,7 @@ b >>>>>>> 4 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-11. @@ -22,4 +23,5 @@ b >>>>>>> 4 +test: ==: unexpected operator Status: 1 * x 6 3c\\ 3b 4c\\ 4b -- 3c\\ 3c 4c\\ 4c -- FAILED --- expected +++ got @@ -10,6 +10,7 @@ >>>>>>> 5 6 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 3-12. @@ -27,4 +28,5 @@ >>>>>>> 5 6 +test: ==: unexpected operator Status: 1 * x 4 2c\\ b 3c\\ a -- 2c\\ c 3c\\ a -- FAILED --- expected +++ got @@ -7,6 +7,7 @@ >>>>>>> a 4 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-11. @@ -22,4 +23,5 @@ a >>>>>>> 4 +test: ==: unexpected operator Status: 1 * x 3 2i\\ b 3i\\ b -- 2i\\ c -- FAILED --- expected +++ got @@ -8,6 +8,7 @@ 2 b 3 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-7, merged at 9. @@ -21,4 +22,5 @@ 2 b 3 +test: ==: unexpected operator Status: 1 * x 3 2i\\ b 3i\\ b 3i\\ b -- 2i\\ c -- FAILED --- expected +++ got @@ -9,6 +9,7 @@ b b 3 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-7, merged at 9-10. @@ -23,4 +24,5 @@ b b 3 +test: ==: unexpected operator Status: 1 * x 9 4c\\ a 5c\\ b 6c\\ a -- 4c\\ a 5c\\ c 6c\\ a -- FAILED --- expected +++ got @@ -12,6 +12,7 @@ 7 8 9 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 4-16. @@ -34,4 +35,5 @@ 7 8 9 +test: ==: unexpected operator Status: 1 * x 3 2i\\ b 3i\\ b -- 1i\\ 0 -- FAILED --- expected +++ got @@ -4,6 +4,8 @@ 2 b 3 +test: ==: unexpected operator +Status: 0 0 1 @@ -11,3 +13,5 @@ 2 b 3 +test: ==: unexpected operator +Status: 0 * x 4 2i\\ b 4i\\ b -- 1i\\ 0 3i\\ c -- FAILED --- expected +++ got @@ -7,6 +7,8 @@ 3 b 4 +test: ==: unexpected operator +Status: 0 Hunk #1 merged at 3,7. 0 @@ -17,3 +19,5 @@ 3 b 4 +test: ==: unexpected operator +Status: 0 * x 5 2,4d -- 3c\\ 3c -- FAILED --- expected +++ got @@ -7,6 +7,7 @@ ======= >>>>>>> 5 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-11. @@ -22,4 +23,5 @@ ======= >>>>>>> 5 +test: ==: unexpected operator Status: 1 * x 5 3c\\ 3c -- 2,4d -- FAILED --- expected +++ got @@ -7,6 +7,7 @@ 4 >>>>>>> 5 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 2-11. @@ -22,4 +23,5 @@ 4 >>>>>>> 5 +test: ==: unexpected operator Status: 1 * x 3 1,2d -- 2i\\ c -- FAILED --- expected +++ got @@ -6,6 +6,7 @@ ======= >>>>>>> 3 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 1-9. @@ -19,4 +20,5 @@ ======= >>>>>>> 3 +test: ==: unexpected operator Status: 1 * x 3 2i\\ c -- 1,2d -- FAILED --- expected +++ got @@ -6,6 +6,7 @@ 2 >>>>>>> 3 +test: ==: unexpected operator Status: 1 Hunk #1 NOT MERGED at 1-9. @@ -19,4 +20,5 @@ 2 >>>>>>> 3 +test: ==: unexpected operator Status: 1 27 tests (0 passed, 27 failed) FAIL merge (exit status: 1)