summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint
diff options
context:
space:
mode:
authorrillig <rillig>2008-11-18 21:17:53 +0000
committerrillig <rillig>2008-11-18 21:17:53 +0000
commit1b41033426a93c23a20462cf2e36a17f99a06121 (patch)
treee1f3d21f64c2b54f8a400bf7fa2daf3d3bd69595 /pkgtools/pkglint
parent6de335e3535222b9c6489c0f625c774bad0c9027 (diff)
downloadpkgsrc-1b41033426a93c23a20462cf2e36a17f99a06121.tar.gz
It's pretty tricky to get the bmake substitution right. At least if
you're a lazy programmer. Now the ${DISTNAME:S...} is interpreted correctly.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl9
1 files changed, 7 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 1e0eada4da6..f01907d0b92 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.787 2008/11/18 19:39:49 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.788 2008/11/18 21:17:53 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -6891,11 +6891,16 @@ sub checkfile_package_Makefile($$) {
if (defined($distname) && defined($pkgname)) {
$pkgname =~ s/\$\{DISTNAME\}/$distname/;
- if ($pkgname =~ m"^(.*)\$\{DISTNAME:S(.)([^:]*)\2([^:]*)\2\}(.*)$") {
+ if ($pkgname =~ m"^(.*)\$\{DISTNAME:S(.)([^:]*)\2([^:]*)\2g?\}(.*)$") {
my ($before, $separator, $old, $new, $after) = ($1, $2, $3, $4, $5);
my $newname = $distname;
+ $old = quotemeta($old);
+ $old =~ s/^\\\^/^/;
+ $old =~ s/\\\$$/\$/;
$newname =~ s/$old/$new/;
+ $opt_debug_misc and $pkgname_line->log_debug("old pkgname=$pkgname");
$pkgname = $before . $newname . $after;
+ $opt_debug_misc and $pkgname_line->log_debug("new pkgname=$pkgname");
}
}