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



details:   https://anonhg.NetBSD.org/pkgsrc/rev/3741d6f1dfff
branches:  trunk
changeset: 382519:3741d6f1dfff
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Sat Jul 30 09:37:21 2022 +0000

description:
lintpkgsrc: merge duplicate code

diffstat:

 pkgtools/lintpkgsrc/files/lintpkgsrc.pl |  17 ++---------------
 1 files changed, 2 insertions(+), 15 deletions(-)

diffs (40 lines):

diff -r 60af577b19a7 -r 3741d6f1dfff pkgtools/lintpkgsrc/files/lintpkgsrc.pl
--- a/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jul 30 09:32:05 2022 +0000
+++ b/pkgtools/lintpkgsrc/files/lintpkgsrc.pl   Sat Jul 30 09:37:21 2022 +0000
@@ -1,6 +1,6 @@
 #!@PERL5@
 
-# $NetBSD: lintpkgsrc.pl,v 1.33 2022/07/30 09:32:05 rillig Exp $
+# $NetBSD: lintpkgsrc.pl,v 1.34 2022/07/30 09:37:21 rillig Exp $
 
 # Written by David Brownlee <abs%netbsd.org@localhost>.
 #
@@ -368,19 +368,6 @@
        eval "$cmp $test 0";
 }
 
-sub parse_expand_vars_dumb($$) {
-       my ($line, $vars) = @_;
-
-       while ($line =~ /\$\{([-\w.]+)\}/) {
-               if (defined(${$vars}{$1})) {
-                       $line = $` . ${$vars}{$1} . $';
-               } else {
-                       $line = $` . $magic_undefined . $';
-               }
-       }
-       $line;
-}
-
 sub parse_expand_vars($$) {
        my ($line, $vars) = @_;
 
@@ -399,7 +386,7 @@
        my ($false, $test);
 
        $false = 0;
-       $test = parse_expand_vars_dumb($line, $vars);
+       $test = parse_expand_vars($line, $vars);
 
        # XXX This is _so_ wrong - need to parse this correctly
        $test =~ s/""/\r/g;



Home | Main Index | Thread Index | Old Index