summaryrefslogtreecommitdiff
path: root/gnu
diff options
context:
space:
mode:
authorEric Bavier <bavier@member.fsf.org>2018-10-03 10:23:51 -0500
committerEric Bavier <bavier@member.fsf.org>2018-10-03 10:45:02 -0500
commit43eb42ef017aa4752503fb2913781bb446716c1e (patch)
tree054fd18c734da873c286f8aaa7a891e79950b614 /gnu
parent227ce488d7b899636e8e8635cbd2d08fb21c56a2 (diff)
quilt: Remove test workarounds.
* gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch, gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch: New files. * gnu/local.mk (dist_patch_DATA): Add them. * gnu/packages/patchutils.scm (quilt)[source]: Use them. [arguments]: Remove workarounds in 'patch-tests' phase.
Diffstat (limited to 'gnu')
-rw-r--r--gnu/local.mk2
-rw-r--r--gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch45
-rw-r--r--gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch58
-rw-r--r--gnu/packages/patchutils.scm14
4 files changed, 108 insertions, 11 deletions
diff --git a/gnu/local.mk b/gnu/local.mk
index b2fda4ac690..61e5913a018 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1102,6 +1102,8 @@ dist_patch_DATA = \
1102 %D%/packages/patches/quagga-reproducible-build.patch \ 1102 %D%/packages/patches/quagga-reproducible-build.patch \
1103 %D%/packages/patches/quickswitch-fix-dmenu-check.patch \ 1103 %D%/packages/patches/quickswitch-fix-dmenu-check.patch \
1104 %D%/packages/patches/quilt-test-fix-regex.patch \ 1104 %D%/packages/patches/quilt-test-fix-regex.patch \
1105 %D%/packages/patches/quilt-compat-getopt-fix-second-separator.patch \
1106 %D%/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch \
1105 %D%/packages/patches/qtwebkit-pbutils-include.patch \ 1107 %D%/packages/patches/qtwebkit-pbutils-include.patch \
1106 %D%/packages/patches/rapicorn-isnan.patch \ 1108 %D%/packages/patches/rapicorn-isnan.patch \
1107 %D%/packages/patches/raptor2-heap-overflow.patch \ 1109 %D%/packages/patches/raptor2-heap-overflow.patch \
diff --git a/gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch b/gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch
new file mode 100644
index 00000000000..6bbec67e75f
--- /dev/null
+++ b/gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch
@@ -0,0 +1,45 @@
1From: Jean Delvare <jdelvare@suse.de>
2Subject: compat/getopt: Allow non-digit parameter embedded in short option
3
4The compatibility getopt script allows only digit parameters to be
5embedded in short options. Util-linux's getopt implementation does
6not have such a restriction and allows any parameter to be embedded
7in short options. As a consequence, using the compatibility getopt
8script would choke for example on "-pab", which is a legal option
9of the "quilt refresh" command.
10
11Remove the limitation on digits so that the compatibility getopt
12script allows what util-linux allows. This fixes the second half
13of bug #54772:
14https://savannah.nongnu.org/bugs/index.php?54772
15
16As a side note, this feature of the compatibility script was broken
17anyway, as it would output the digits in reverse order.
18
19Signed-off-by: Jean Delvare <jdelvare@suse.de>
20---
21 compat/getopt.in | 13 ++++---------
22 1 file changed, 4 insertions(+), 9 deletions(-)
23
24--- quilt.orig/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200
25+++ quilt/compat/getopt.in 2018-10-03 16:12:17.624841732 +0200
26@@ -108,15 +108,10 @@ foreach my $word (@words) {
27 if (scalar(@letters) == 0) {
28 $need_param = $letter;
29 } else {
30- # short options can have numerical args
31- # embedded in the short option list: -UO
32- die "unexpected character after option $letter"
33- if ($letters[$#letters] !~ /[0-9]/);
34- my @digits;
35- while (scalar(@letters) && ($letters[$#letters] =~ /[0-9]/)) {
36- push @digits, pop @letters;
37- }
38- push @options, quote_word(join('', reverse @digits));
39+ # short options can have args
40+ # embedded in the short option list
41+ push @options, quote_word(join('', reverse @letters));
42+ @letters = ();
43 }
44 }
45 }
diff --git a/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch b/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch
new file mode 100644
index 00000000000..cde2c8d41c7
--- /dev/null
+++ b/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch
@@ -0,0 +1,58 @@
1From: Jean Delvare <jdelvare@suse.de>
2Subject: compat/getopt: Handle a second separator
3
4getopt can be passed 2 '--' separators. The first one tells that
5getopt options are over and target program options start. The second
6one tells that the target program's options are over and following
7arguments should be treated as non-options even if they look like
8options.
9
10This second separator was not handled, causing the compatibility
11getopt script to treat the following arguments as options, eventually
12failing one way or another.
13
14Properly detect and handle the second separator. This fixes the first
15half of bug #54772:
16https://savannah.nongnu.org/bugs/index.php?54772
17
18Signed-off-by: Jean Delvare <jdelvare@suse.de>
19---
20 compat/getopt.in | 13 ++++++++++---
21 1 file changed, 10 insertions(+), 3 deletions(-)
22
23--- quilt.orig/compat/getopt.in 2018-10-03 15:23:21.147620172 +0200
24+++ quilt/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200
25@@ -8,12 +8,12 @@
26
27 use strict;
28
29-my $opts;
30+my $opts = '';
31 my @words;
32 my $found_sep = 0;
33
34 foreach my $arg (@ARGV) {
35- if ($arg eq '--') {
36+ if (!$found_sep && $arg eq '--') {
37 $found_sep = 1;
38 }
39 else {
40@@ -62,10 +62,17 @@ sub quote_word
41 return "'$word'";
42 }
43
44+# there can be a second separator, to inhibit processing following arguments
45+# as options
46+$found_sep = 0;
47 foreach my $word (@words) {
48+ if ($word eq '--') {
49+ $found_sep = 1;
50+ next;
51+ }
52
53 # allow '-' to be an option value
54- if (!$need_param && $word !~ /^-./) {
55+ if ($found_sep || (!$need_param && $word !~ /^-./)) {
56 push @barewords, quote_word($word);
57 next;
58 }
diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm
index da20ae1c3fa..688e62cdc83 100644
--- a/gnu/packages/patchutils.scm
+++ b/gnu/packages/patchutils.scm
@@ -103,7 +103,9 @@ listing the files modified by a patch.")
103 (sha256 103 (sha256
104 (base32 104 (base32
105 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn")) 105 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn"))
106 (patches (search-patches "quilt-test-fix-regex.patch")))) 106 (patches (search-patches "quilt-test-fix-regex.patch"
107 "quilt-compat-getopt-fix-second-separator.patch"
108 "quilt-compat-getopt-fix-option-with-nondigit-param.patch"))))
107 (build-system gnu-build-system) 109 (build-system gnu-build-system)
108 (native-inputs 110 (native-inputs
109 `(("gettext" ,gnu-gettext))) 111 `(("gettext" ,gnu-gettext)))
@@ -122,16 +124,6 @@ listing the files modified by a patch.")
122 '("test/run" 124 '("test/run"
123 "test/edit.test") 125 "test/edit.test")
124 (("/bin/sh") (which "sh"))) 126 (("/bin/sh") (which "sh")))
125 (substitute* "test/create-delete.test"
126 ;; We'd rather use quilt's compat/getopt than declare a
127 ;; dependency on util-linux, but this test fails because of
128 ;; compat/getopt's handling of "---" in this test, so remove it
129 ;; for now.
130 ((" ---") ""))
131 (substitute* '("test/empty-files.test" "test/faildiff.test")
132 ;; compat/getopt seems not to handle splitting of short opts
133 ;; from its arguments.
134 (("-pab") "-p ab"))
135 #t)) 127 #t))
136 (add-after 'install 'wrap-program 128 (add-after 'install 'wrap-program
137 ;; quilt's configure checks for the absolute path to the utilities it 129 ;; quilt's configure checks for the absolute path to the utilities it