summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorrillig <rillig@pkgsrc.org>2008-10-16 09:08:21 +0000
committerrillig <rillig@pkgsrc.org>2008-10-16 09:08:21 +0000
commitdfb4d9ed10308f545aa41419c43939ef0367a75f (patch)
tree87a9da5fbca9608e998dde989a818f66c6a1fa18 /pkgtools
parent0bf918933d88d3b1f7508af192226611e2d98162 (diff)
downloadpkgsrc-dfb4d9ed10308f545aa41419c43939ef0367a75f.tar.gz
Fixed two issues reported by wiz:
- Perl 5.10 complains when closedir() is called on an undefined directory handle, and is correct to do so. Since directory handles are global variables, they must be used carefully in recursive functions. - The PLIST.* variables still had some warning suspecting a "spelling mistake". This has been fixed by marking all PLIST_VARS as being used.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/files/pkglint.pl8
1 files changed, 5 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 35b39fa1b1d..3eb278b724e 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -1,5 +1,5 @@
#! @PERL@
-# $NetBSD: pkglint.pl,v 1.774 2008/10/09 16:19:24 rillig Exp $
+# $NetBSD: pkglint.pl,v 1.775 2008/10/16 09:08:21 rillig Exp $
#
# pkglint - static analyzer and checker for pkgsrc packages
@@ -2752,9 +2752,11 @@ sub is_emptydir($) {
if (!opendir(DIR, $dir)) {
return true;
}
+ my @subdirs = readdir(DIR);
+ closedir(DIR) or die;
$rv = true;
- foreach my $subdir (readdir(DIR)) {
+ foreach my $subdir (@subdirs) {
next if $subdir eq "." || $subdir eq ".." || $subdir eq "CVS";
next if -d "${dir}/${subdir}" && is_emptydir("${dir}/${subdir}");
@@ -2762,7 +2764,6 @@ sub is_emptydir($) {
last;
}
- closedir(DIR);
return $rv;
}
@@ -6256,6 +6257,7 @@ sub checklines_mk($) {
foreach my $id (split(qr"\s+", $line->get("value"))) {
$mkctx_plist_vars->{"PLIST.$id"} = true;
$opt_debug_misc and $line->log_debug("PLIST.${id} is added to PLIST_VARS.");
+ use_var($line, "PLIST.$id");
}
} elsif ($varcanon eq "USE_TOOLS") {