diff options
author | rillig <rillig@pkgsrc.org> | 2007-11-07 11:58:57 +0000 |
---|---|---|
committer | rillig <rillig@pkgsrc.org> | 2007-11-07 11:58:57 +0000 |
commit | 168edd665088a69dd1ac49819097e14357ea3ecd (patch) | |
tree | c69c51ba0554f44774323950a9408f79ded82bd0 /pkgtools | |
parent | ef77fd8fa4fb54aae109dd12c1d00c786f106b37 (diff) | |
download | pkgsrc-168edd665088a69dd1ac49819097e14357ea3ecd.tar.gz |
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 (limited to 'pkgtools')
-rw-r--r-- | pkgtools/pkglint/files/pkglint.pl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl index 5e4b954e18e..33c8fedae3b 100644 --- a/pkgtools/pkglint/files/pkglint.pl +++ b/pkgtools/pkglint/files/pkglint.pl @@ -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 @@ sub checkfile_PLIST($) { # 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 @@ sub checkfile_PLIST($) { $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}) { |