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: accept duplicate...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/99f4064118da
branches:  trunk
changeset: 383179:99f4064118da
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sun Aug 14 12:54:01 2022 +0000

description:
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.

diffstat:

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

diffs (41 lines):

diff -r 1e4e72d41a71 -r 99f4064118da pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sun Aug 14 12:46:39 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sun Aug 14 12:54:01 2022 +0000
@@ -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 @@
 
        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;
diff -r 1e4e72d41a71 -r 99f4064118da pkgtools/lintpkgsrc/files/t/glob.t
--- a/pkgtools/lintpkgsrc/files/t/glob.t        Sun Aug 14 12:46:39 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/t/glob.t        Sun Aug 14 12:54:01 2022 +0000
@@ -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 @@
            [ '<{,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