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:54:01 UTC 2022

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

Log Message:
lintpkgsrc: accept duplicate strings from brace expansion, for now

Having duplicate expanded strings is not as bad as having missed
alternatives, it's only a question of performance.


To generate a diff of this commit:
cvs rdiff -u -r1.94 -r1.95 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl
cvs rdiff -u -r1.12 -r1.13 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.94 pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.95
--- pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl:1.94 Sun Aug 14 12:44:17 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/lintpkgsrc.pl      Sun Aug 14 12:54:01 2022
@@ -1,5 +1,5 @@
 #!@PERL5@
-# $NetBSD: lintpkgsrc.pl,v 1.94 2022/08/14 12:44:17 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.95 2022/08/14 12:54:01 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -251,10 +251,9 @@ sub expand_braces($str) {
 
        my @expanded;
        while (defined($str = shift @todo)) {
-               # FIXME: see test_expand_braces.
                if ($str =~ /(.*) \{ ([^{}]+) } (.*)/x) {
-                       foreach (split(',', $2, -1)) {
-                               push @todo, "$1$_$3";
+                       foreach my $alt (split(',', $2, -1)) {
+                               push @todo, "$1$alt$3";
                        }
                } else {
                        push @expanded, $str;

Index: pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t
diff -u pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t:1.12 pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t:1.13
--- pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t:1.12      Sun Aug 14 12:46:39 2022
+++ pkgsrc/pkgtools/lintpkgsrc/files/t/glob.t   Sun Aug 14 12:54:01 2022
@@ -1,4 +1,4 @@
-# $NetBSD: glob.t,v 1.12 2022/08/14 12:46:39 rillig Exp $
+# $NetBSD: glob.t,v 1.13 2022/08/14 12:54:01 rillig Exp $
 #
 # Tests for file globbing and matching.
 
@@ -67,7 +67,7 @@ sub test_expand_braces() {
            [ '<{,opt}>', '<>', '<opt>' ],
            [ '{0,1,2}', '0', '1', '2' ],
            [ '{2,1,0}', '2', '1', '0' ],
-           # FIXME: duplicate 'thirteen'.
+           # XXX: duplicate 'thirteen'.
            [ '{thir,f{our,if}}teen', 'thirteen', 'fourteen', 'thirteen', 'fifteen' ]
        );
 



Home | Main Index | Thread Index | Old Index