diff options
author | abs <abs@pkgsrc.org> | 2000-09-21 10:28:44 +0000 |
---|---|---|
committer | abs <abs@pkgsrc.org> | 2000-09-21 10:28:44 +0000 |
commit | f489fd9111ba8ec85a9a114f04ac95bf4330282c (patch) | |
tree | 0145953c442316d5e07d416e5d6477476ac1baf1 /pkgtools/pkglint/files | |
parent | c17d1d5b5ad26d3100c514eb2b7f71d087e09d0e (diff) | |
download | pkgsrc-f489fd9111ba8ec85a9a114f04ac95bf4330282c.tar.gz |
pkglint:
lintpkgsrc - fix :S modifier behaviour - broken in last commit
Diffstat (limited to 'pkgtools/pkglint/files')
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index d70a9224abc..0f6a8648ffc 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!/usr/bin/env perl -# $NetBSD: lintpkgsrc.pl,v 1.31 2000/09/20 06:39:28 abs Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.32 2000/09/21 10:28:44 abs Exp $ # Written by David Brownlee <abs@netbsd.org>. # @@ -636,16 +636,10 @@ sub parse_makefile_vars my($how, $from, $to, $global) = ($1, $2, $3, $4); debug("substitute: $subvar, $how, $from, $to, $global\n"); - if ($how eq 'S') - { - if (($_ = index($result, $from)) != -1) - { substr($result, $_, length($from), $to); } - } - else - { - $to =~ s/\\(\d)/\$$1/g; # Change \1 etc to $1 - eval "\$result =~ s/$from/$to/$global"; - } + if ($how eq 'S') # Limited substitution - keep ^ and $ + { $from =~ s/[?.{}\]\[*+]/\$1/g; } + $to =~ s/\\(\d)/\$$1/g; # Change \1 etc to $1 + eval "\$result =~ s/$from/$to/$global"; } $vars{$key} = $left . $result . $right; $loop = 1; |