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; } ='5557d4052bdfb0d00088b08b1d416ae59182fcb7'/>
AgeCommit message (Expand)Author
2021-08-12records: Support field sanitizers....* guix/records.scm (make-syntactic-constructor): Add #:sanitizers. [field-sanitizer]: New procedure. [wrap-field-value]: Honor F's sanitizer. (define-record-type*)[field-sanitizer]: New procedure. Pass #:sanitizer to 'make-syntactic-constructor'. * tests/records.scm ("define-record-type* & sanitize") ("define-record-type* & sanitize & thunked"): New tests. Ludovic Courtès
2021-04-29diagnostics, ui: Adjust to 'read-error' and 'syntax-error' in Guile 3.0.6....* guix/diagnostics.scm (source-properties->location): Add clause for vectors. * guix/ui.scm (report-load-error): Tweak 'read-error' handling for 3.0.6. * tests/guix-package.sh: Relax regexp for the "unbound variable" diagnostic check. * tests/guix-system.sh: Adjust "missing closing paren" check for 3.0.6. * tests/records.scm (location-alist): New procedure. ("define-record-type* & wrong field specifier") ("define-record-type* & wrong field specifier, identifier") ("define-record-type* & duplicate initializers"): Use it. Ludovic Courtès
2020-01-16records: Improve reporting of "invalid field specifier" errors....Previously users would just see: error: invalid field specifier without source location or hints. * guix/records.scm (expand): Add optional 'parent-form' parameter and pass it to 'syntax-violation' when it is true. (make-syntactic-constructor): Pass S as a third argument to 'report-invalid-field-specifier'. * guix/ui.scm (report-load-error): For 'syntax-error', show SUBFORM or FORM in the message. * tests/records.scm ("define-record-type* & wrong field specifier"): Add a 'subform' parameter and adjust test accordingly. ("define-record-type* & wrong field specifier, identifier"): New test. * tests/guix-system.sh: Add test. Ludovic Courtès