pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Outside of packages, the :M* op...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/d2c7727161fc
branches:  trunk
changeset: 523163:d2c7727161fc
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Tue Jan 02 23:01:24 2007 +0000

description:
Outside of packages, the :M* operator has to be used sometimes.

When .PHONY appears as the source in a dependency line, all targets are
considered "virtual" targets.

diffstat:

 pkgtools/pkglint/files/pkglint.pl |  14 ++++++++++++--
 1 files changed, 12 insertions(+), 2 deletions(-)

diffs (36 lines):

diff -r 2414945bd6ef -r d2c7727161fc pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Tue Jan 02 23:00:11 2007 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Tue Jan 02 23:01:24 2007 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.689 2007/01/02 22:27:44 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.690 2007/01/02 23:01:24 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -3900,7 +3900,9 @@
                # configure scripts.
                my $need_mstar = false;
                if ($varname =~ regex_gnu_configure_volatile_vars) {
-                       if (defined($pkgctx_vardef) && exists($pkgctx_vardef->{"GNU_CONFIGURE"})) {
+                       # When we are not checking a package, but some other file,
+                       # the :M* operator is needed for safety.
+                       if (!defined($pkgctx_vardef) || exists($pkgctx_vardef->{"GNU_CONFIGURE"})) {
                                $need_mstar = true;
                        }
                }
@@ -5991,6 +5993,14 @@
                        $opt_debug_misc and $line->log_debug("targets=${targets}, dependencies=${dependencies}");
                        $mkctx_target = $targets;
 
+                       foreach my $source (split(/\s+/, $dependencies)) {
+                               if ($source eq ".PHONY") {
+                                       foreach my $target (split(/\s+/, $targets)) {
+                                               $allowed_targets->{$target} = true;
+                                       }
+                               }
+                       }
+
                        foreach my $target (split(/\s+/, $targets)) {
                                if ($target eq ".PHONY") {
                                        foreach my $dep (split(qr"\s+", $dependencies)) {



Home | Main Index | Thread Index | Old Index