pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/lintpkgsrc/files lintpkgsrc: fix brace expans...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e6f3023124b7
branches:  trunk
changeset: 383177:e6f3023124b7
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Aug 14 12:44:17 2022 +0000

description:
lintpkgsrc: fix brace expansion for empty alternatives

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  5 ++---
 pkgtools/lintpkgsrc/files/t/glob.t      |  5 ++---
 2 files changed, 4 insertions(+), 6 deletions(-)

diffs (39 lines):

diff -r a6d9b098df36 -r e6f3023124b7 pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sun Aug 14 12:42:38 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sun Aug 14 12:44:17 2022 +0000
@@ -1,5 +1,5 @@
 #!@PERL5@
-# $NetBSD: lintpkgsrc.pl,v 1.93 2022/08/14 12:42:38 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.94 2022/08/14 12:44:17 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -253,8 +253,7 @@
        while (defined($str = shift @todo)) {
                # FIXME: see test_expand_braces.
                if ($str =~ /(.*) \{ ([^{}]+) } (.*)/x) {
-                       # FIXME: see test_expand_braces.
-                       foreach (split(',', $2)) {
+                       foreach (split(',', $2, -1)) {
                                push @todo, "$1$_$3";
                        }
                } else {
diff -r a6d9b098df36 -r e6f3023124b7 pkgtools/lintpkgsrc/files/t/glob.t
--- a/pkgtools/lintpkgsrc/files/t/glob.t        Sun Aug 14 12:42:38 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/t/glob.t        Sun Aug 14 12:44:17 2022 +0000
@@ -1,4 +1,4 @@
-# $NetBSD: glob.t,v 1.10 2022/08/14 12:42:38 rillig Exp $
+# $NetBSD: glob.t,v 1.11 2022/08/14 12:44:17 rillig Exp $
 #
 # Tests for file globbing and matching.
 
@@ -63,8 +63,7 @@
            [ '', ],
            [ 'abc', 'abc' ],
            [ '{a,b,c}', 'a', 'b', 'c' ],
-           # FIXME: '<>' is missing.
-           [ '<{opt,}>', '<opt>' ],
+           [ '<{opt,}>', '<opt>', '<>' ],
            [ '<{,opt}>', '<>', '<opt>' ],
            [ '{0,1,2}', '0', '1', '2' ],
            [ '{2,1,0}', '2', '1', '0' ],



Home | Main Index | Thread Index | Old Index