From c16c119d0a7894c42bbe816ec381a0f458f26e6a Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Tue, 4 Dec 2018 22:55:46 +0100 Subject: gnu: quilt: Use shorter file names for patches. We were reaching the 99-character limit of POSIX tar. * gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch: Rename to... * gnu/packages/patches/quilt-getopt-nondigit-param.patch: ... this. * gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch: Rename to... * gnu/packages/patches/quilt-getopt-second-separator.patch: ... this. * gnu/local.mk (dist_patch_DATA): Adjust accordingly. * gnu/packages/patchutils.scm (quilt)[source](patches): Likewise. --- gnu/local.mk | 4 +- ...pat-getopt-fix-option-with-nondigit-param.patch | 45 ----------------- .../quilt-compat-getopt-fix-second-separator.patch | 58 ---------------------- .../patches/quilt-getopt-nondigit-param.patch | 45 +++++++++++++++++ .../patches/quilt-getopt-second-separator.patch | 58 ++++++++++++++++++++++ gnu/packages/patchutils.scm | 4 +- 6 files changed, 107 insertions(+), 107 deletions(-) delete mode 100644 gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch delete mode 100644 gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch create mode 100644 gnu/packages/patches/quilt-getopt-nondigit-param.patch create mode 100644 gnu/packages/patches/quilt-getopt-second-separator.patch (limited to 'gnu') diff --git a/gnu/local.mk b/gnu/local.mk index 53a3547559..d2407bb80e 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -1119,8 +1119,8 @@ dist_patch_DATA = \ %D%/packages/patches/quagga-reproducible-build.patch \ %D%/packages/patches/quickswitch-fix-dmenu-check.patch \ %D%/packages/patches/quilt-test-fix-regex.patch \ - %D%/packages/patches/quilt-compat-getopt-fix-second-separator.patch \ - %D%/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch \ + %D%/packages/patches/quilt-getopt-nondigit-param.patch \ + %D%/packages/patches/quilt-getopt-second-separator.patch \ %D%/packages/patches/qtwebkit-pbutils-include.patch \ %D%/packages/patches/randomjungle-disable-static-build.patch \ %D%/packages/patches/rapicorn-isnan.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 deleted file mode 100644 index 6bbec67e75..0000000000 --- a/gnu/packages/patches/quilt-compat-getopt-fix-option-with-nondigit-param.patch +++ /dev/null @@ -1,45 +0,0 @@ -From: Jean Delvare -Subject: compat/getopt: Allow non-digit parameter embedded in short option - -The compatibility getopt script allows only digit parameters to be -embedded in short options. Util-linux's getopt implementation does -not have such a restriction and allows any parameter to be embedded -in short options. As a consequence, using the compatibility getopt -script would choke for example on "-pab", which is a legal option -of the "quilt refresh" command. - -Remove the limitation on digits so that the compatibility getopt -script allows what util-linux allows. This fixes the second half -of bug #54772: -https://savannah.nongnu.org/bugs/index.php?54772 - -As a side note, this feature of the compatibility script was broken -anyway, as it would output the digits in reverse order. - -Signed-off-by: Jean Delvare ---- - compat/getopt.in | 13 ++++--------- - 1 file changed, 4 insertions(+), 9 deletions(-) - ---- quilt.orig/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200 -+++ quilt/compat/getopt.in 2018-10-03 16:12:17.624841732 +0200 -@@ -108,15 +108,10 @@ foreach my $word (@words) { - if (scalar(@letters) == 0) { - $need_param = $letter; - } else { -- # short options can have numerical args -- # embedded in the short option list: -UO -- die "unexpected character after option $letter" -- if ($letters[$#letters] !~ /[0-9]/); -- my @digits; -- while (scalar(@letters) && ($letters[$#letters] =~ /[0-9]/)) { -- push @digits, pop @letters; -- } -- push @options, quote_word(join('', reverse @digits)); -+ # short options can have args -+ # embedded in the short option list -+ push @options, quote_word(join('', reverse @letters)); -+ @letters = (); - } - } - } diff --git a/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch b/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch deleted file mode 100644 index cde2c8d41c..0000000000 --- a/gnu/packages/patches/quilt-compat-getopt-fix-second-separator.patch +++ /dev/null @@ -1,58 +0,0 @@ -From: Jean Delvare -Subject: compat/getopt: Handle a second separator - -getopt can be passed 2 '--' separators. The first one tells that -getopt options are over and target program options start. The second -one tells that the target program's options are over and following -arguments should be treated as non-options even if they look like -options. - -This second separator was not handled, causing the compatibility -getopt script to treat the following arguments as options, eventually -failing one way or another. - -Properly detect and handle the second separator. This fixes the first -half of bug #54772: -https://savannah.nongnu.org/bugs/index.php?54772 - -Signed-off-by: Jean Delvare ---- - compat/getopt.in | 13 ++++++++++--- - 1 file changed, 10 insertions(+), 3 deletions(-) - ---- quilt.orig/compat/getopt.in 2018-10-03 15:23:21.147620172 +0200 -+++ quilt/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200 -@@ -8,12 +8,12 @@ - - use strict; - --my $opts; -+my $opts = ''; - my @words; - my $found_sep = 0; - - foreach my $arg (@ARGV) { -- if ($arg eq '--') { -+ if (!$found_sep && $arg eq '--') { - $found_sep = 1; - } - else { -@@ -62,10 +62,17 @@ sub quote_word - return "'$word'"; - } - -+# there can be a second separator, to inhibit processing following arguments -+# as options -+$found_sep = 0; - foreach my $word (@words) { -+ if ($word eq '--') { -+ $found_sep = 1; -+ next; -+ } - - # allow '-' to be an option value -- if (!$need_param && $word !~ /^-./) { -+ if ($found_sep || (!$need_param && $word !~ /^-./)) { - push @barewords, quote_word($word); - next; - } diff --git a/gnu/packages/patches/quilt-getopt-nondigit-param.patch b/gnu/packages/patches/quilt-getopt-nondigit-param.patch new file mode 100644 index 0000000000..6bbec67e75 --- /dev/null +++ b/gnu/packages/patches/quilt-getopt-nondigit-param.patch @@ -0,0 +1,45 @@ +From: Jean Delvare +Subject: compat/getopt: Allow non-digit parameter embedded in short option + +The compatibility getopt script allows only digit parameters to be +embedded in short options. Util-linux's getopt implementation does +not have such a restriction and allows any parameter to be embedded +in short options. As a consequence, using the compatibility getopt +script would choke for example on "-pab", which is a legal option +of the "quilt refresh" command. + +Remove the limitation on digits so that the compatibility getopt +script allows what util-linux allows. This fixes the second half +of bug #54772: +https://savannah.nongnu.org/bugs/index.php?54772 + +As a side note, this feature of the compatibility script was broken +anyway, as it would output the digits in reverse order. + +Signed-off-by: Jean Delvare +--- + compat/getopt.in | 13 ++++--------- + 1 file changed, 4 insertions(+), 9 deletions(-) + +--- quilt.orig/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200 ++++ quilt/compat/getopt.in 2018-10-03 16:12:17.624841732 +0200 +@@ -108,15 +108,10 @@ foreach my $word (@words) { + if (scalar(@letters) == 0) { + $need_param = $letter; + } else { +- # short options can have numerical args +- # embedded in the short option list: -UO +- die "unexpected character after option $letter" +- if ($letters[$#letters] !~ /[0-9]/); +- my @digits; +- while (scalar(@letters) && ($letters[$#letters] =~ /[0-9]/)) { +- push @digits, pop @letters; +- } +- push @options, quote_word(join('', reverse @digits)); ++ # short options can have args ++ # embedded in the short option list ++ push @options, quote_word(join('', reverse @letters)); ++ @letters = (); + } + } + } diff --git a/gnu/packages/patches/quilt-getopt-second-separator.patch b/gnu/packages/patches/quilt-getopt-second-separator.patch new file mode 100644 index 0000000000..cde2c8d41c --- /dev/null +++ b/gnu/packages/patches/quilt-getopt-second-separator.patch @@ -0,0 +1,58 @@ +From: Jean Delvare +Subject: compat/getopt: Handle a second separator + +getopt can be passed 2 '--' separators. The first one tells that +getopt options are over and target program options start. The second +one tells that the target program's options are over and following +arguments should be treated as non-options even if they look like +options. + +This second separator was not handled, causing the compatibility +getopt script to treat the following arguments as options, eventually +failing one way or another. + +Properly detect and handle the second separator. This fixes the first +half of bug #54772: +https://savannah.nongnu.org/bugs/index.php?54772 + +Signed-off-by: Jean Delvare +--- + compat/getopt.in | 13 ++++++++++--- + 1 file changed, 10 insertions(+), 3 deletions(-) + +--- quilt.orig/compat/getopt.in 2018-10-03 15:23:21.147620172 +0200 ++++ quilt/compat/getopt.in 2018-10-03 16:05:56.818667040 +0200 +@@ -8,12 +8,12 @@ + + use strict; + +-my $opts; ++my $opts = ''; + my @words; + my $found_sep = 0; + + foreach my $arg (@ARGV) { +- if ($arg eq '--') { ++ if (!$found_sep && $arg eq '--') { + $found_sep = 1; + } + else { +@@ -62,10 +62,17 @@ sub quote_word + return "'$word'"; + } + ++# there can be a second separator, to inhibit processing following arguments ++# as options ++$found_sep = 0; + foreach my $word (@words) { ++ if ($word eq '--') { ++ $found_sep = 1; ++ next; ++ } + + # allow '-' to be an option value +- if (!$need_param && $word !~ /^-./) { ++ if ($found_sep || (!$need_param && $word !~ /^-./)) { + push @barewords, quote_word($word); + next; + } diff --git a/gnu/packages/patchutils.scm b/gnu/packages/patchutils.scm index fa5ad62e44..b655399345 100644 --- a/gnu/packages/patchutils.scm +++ b/gnu/packages/patchutils.scm @@ -102,8 +102,8 @@ listing the files modified by a patch.") (base32 "06b816m2gz9jfif7k9v2hrm7fz76zjg5pavf7hd3ifybwn4cgjzn")) (patches (search-patches "quilt-test-fix-regex.patch" - "quilt-compat-getopt-fix-second-separator.patch" - "quilt-compat-getopt-fix-option-with-nondigit-param.patch")))) + "quilt-getopt-second-separator.patch" + "quilt-getopt-nondigit-param.patch")))) (build-system gnu-build-system) (native-inputs `(("gettext" ,gnu-gettext))) -- cgit v1.2.3