pkgsrc-Changes archive

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

CVS commit: pkgsrc/pkgtools/lintpkgsrc/files



Module Name:    pkgsrc
Committed By:   rillig
Date:           Sun Aug 14 12:44:17 UTC 2022

Modified Files:
        pkgsrc/pkgtools/lintpkgsrc/files: lintpkgsrc.pl
        pkgsrc/pkgtools/lintpkgsrc/files/t: glob.t

Log Message:
lintpkgsrc: fix brace expansion for empty alternatives


To generate a diff of this commit:
cvs rdiff -u -r1.93 -r1.94 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
cvs rdiff -u -r1.10 -r1.11 pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
diff -u pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.93 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.94
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.93 Sun Aug 14 12:42:38 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Sun Aug 14 12:44:17 2022
@@ -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 @@ sub expand_braces($str) {
        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 {

Index: pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t
diff -u pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t:1.10 pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t:1.11
--- pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t:1.10      Sun Aug 14 12:42:38 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t   Sun Aug 14 12:44:17 2022
@@ -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 @@ sub test_expand_braces() {
            [ '', ],
            [ '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