diff options
author | rillig <rillig@pkgsrc.org> | 2022-08-14 12:54:01 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2022-08-14 12:54:01 +0000 |
commit | 34e57796a9a4f65ea033cd0ff93f6311fb1acbcd (patch) | |
tree | 142dc8256a34981a33b51d28d46354e929520d29 /pkgtools/lintpkgsrc | |
parent | 86af421b60d50299e5c1dc7deee1b345a1f3f9f0 (diff) | |
download | pkgsrc-34e57796a9a4f65ea033cd0ff93f6311fb1acbcd.tar.gz |
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 (limited to 'pkgtools/lintpkgsrc')
-rwxr-xr-x | pkgtools/lintpkgsrc/files/lintpkgsrc.pl | 7 | ||||
-rw-r--r-- | pkgtools/lintpkgsrc/files/t/glob.t | 4 |
2 files changed, 5 insertions, 6 deletions
diff --git a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl index cba0de01617..e0875c9eb70 100755 --- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl +++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl @@ -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>. # @@ -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; diff --git a/pkgtools/lintpkgsrc/files/t/glob.t b/pkgtools/lintpkgsrc/files/t/glob.t index e76fa5d90a7..9666b7c51fd 100644 --- a/pkgtools/lintpkgsrc/files/t/glob.t +++ b/pkgtools/lintpkgsrc/files/t/glob.t @@ -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' ] ); |