pkgsrc-Changes-HG archive

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

[pkgsrc/trunk]: pkgsrc/pkgtools/pkglint/files Directories may be removed in a...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/e886d6ad04a4
branches:  trunk
changeset: 535079:e886d6ad04a4
user:      rillig <rillig%pkgsrc.org@localhost>
date:      Wed Nov 07 11:58:57 2007 +0000

description:
Directories may be removed in a PLIST if there is a corresponding @exec
${MKDIR}.

In PLIST.common_end, directories that have been populated in
PLIST.common may also be removed.

XXX: The PLIST_SUBST macros that may expand to "@comment " are currently
not distinguished from pathname macros. This leads to some false
positive warnings.

diffstat:

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

diffs (33 lines):

diff -r e4f56f029a34 -r e886d6ad04a4 pkgtools/pkglint/files/pkglint.pl
--- a/pkgtools/pkglint/files/pkglint.pl Wed Nov 07 11:51:52 2007 +0000
+++ b/pkgtools/pkglint/files/pkglint.pl Wed Nov 07 11:58:57 2007 +0000
@@ -1,5 +1,5 @@
 #! @PERL@
-# $NetBSD: pkglint.pl,v 1.728 2007/11/07 11:09:07 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.729 2007/11/07 11:58:57 rillig Exp $
 #
 
 # pkglint - static analyzer and checker for pkgsrc packages
@@ -7330,7 +7330,8 @@
        # Get the list of all files from the PLIST.
        my $all_files = {};
        my $all_dirs = {};
-       foreach my $line (@{$lines}) {
+       my $extra_lines = (basename($fname) eq "PLIST.common_end") ? load_file(dirname($fname) . "PLIST.common") : [];
+       foreach my $line (@{$extra_lines}, @{$lines}) {
                my $text = $line->text;
 
                if ($text =~ qr"^[\w\$]") {
@@ -7340,6 +7341,12 @@
                                $all_dirs->{$dir} = $line;
                        }
                }
+               if ($text =~ qr"^\@exec \$\{MKDIR\} %D/(.*)$") {
+                       my $dir = $1;
+                       do {
+                               $all_dirs->{$dir} = $line;
+                       } while ($dir =~ s,/[^/]+$,,);
+               }
        }
 
        foreach my $line (@{$lines}) {



Home | Main Index | Thread Index | Old Index