summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig>2006-09-15 12:31:49 +0000
committerrillig <rillig>2006-09-15 12:31:49 +0000
commit7ecdc6dfcc41bb1cf5ef69774a13e6ab40755a3d (patch)
tree2cd1e95b4e03eb5de34d9962f5bf5e835346f8d2 /pkgtools
parent9acad648510193605ab73500a7ba0f2df0388a0f (diff)
downloadpkgsrc-7ecdc6dfcc41bb1cf5ef69774a13e6ab40755a3d.tar.gz
The :M* operator is only needed when the package has a GNU-style
configure script.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl20
1 files changed, 17 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index e2ddef0cd6f..769c078076c 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.673 2006/09/08 07:45:36 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.674 2006/09/15 12:31:49 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -3849,10 +3849,24 @@ sub checkline_mk_varuse($$$$) {
}
if ($context->shellword != VUC_SHELLWORD_UNKNOWN && $needs_quoting != dont_know) {
+
+ # In GNU configure scripts, a few variables need to be
+ # passed through the :M* operator before they reach the
+ # configure scripts.
+ my $need_mstar = false;
+ if ($varname =~ regex_gnu_configure_volatile_vars) {
+ if (defined($pkgctx_vardef) && exists($pkgctx_vardef->{"GNU_CONFIGURE"})) {
+ $need_mstar = true;
+ }
+ }
+
my $stripped_mod = ($mod =~ qr"(.*?)(?::M\*)?(?::Q)?$") ? $1 : $mod;
- my $correct_mod = $stripped_mod . (($varname =~ regex_gnu_configure_volatile_vars) ? ":M*:Q" : ":Q");
+ my $correct_mod = $stripped_mod . ($need_mstar ? ":M*:Q" : ":Q");
+
+ if ($mod eq ":M*:Q" && !$need_mstar) {
+ $line->log_note("The :M* modifier is not needed here.");
- if ($mod ne $correct_mod && $needs_quoting == true) {
+ } elsif ($mod ne $correct_mod && $needs_quoting == true) {
if ($context->shellword == VUC_SHELLWORD_PLAIN) {
$line->log_warning("Please use \${${varname}${correct_mod}} instead of \${${varname}${mod}}.");
#$line->replace("\${${varname}}", "\${${varname}:Q}");