aboutsummaryrefslogtreecommitdiff
path: root/gnu/packages/patches/quilt-getopt-second-separator.patch
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2018-12-04 22:55:46 +0100
committerLudovic Courtès <ludo@gnu.org>2018-12-05 00:08:28 +0100
commitc16c119d0a7894c42bbe816ec381a0f458f26e6a (patch)
treeecc05876c10ce19cfbb7ae1dc53b495246380e40 /gnu/packages/patches/quilt-getopt-second-separator.patch
parent040ae1881952c90dae9478e5cfff6aad0ce950da (diff)
downloadguix-c16c119d0a7894c42bbe816ec381a0f458f26e6a.tar.gz
guix-c16c119d0a7894c42bbe816ec381a0f458f26e6a.zip
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.
Diffstat (limited to 'gnu/packages/patches/quilt-getopt-second-separator.patch')
-rw-r--r--gnu/packages/patches/quilt-getopt-second-separator.patch58
1 files changed, 58 insertions, 0 deletions
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 <jdelvare@suse.de>
+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 <jdelvare@suse.de>
+---
+ 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;
+ }