summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint
diff options
context:
space:
mode:
authorwiz <wiz>2002-12-10 12:42:40 +0000
committerwiz <wiz>2002-12-10 12:42:40 +0000
commit07b88a93e244cd2491b2e4b60c41f7043f9692e4 (patch)
tree58a211b4f18fee6b41bc2f4fce6fcee9ea5ce6c0 /pkgtools/pkglint
parentc2ec7eb529607cb666417940efd25235a518aef0 (diff)
downloadpkgsrc-07b88a93e244cd2491b2e4b60c41f7043f9692e4.tar.gz
Update to 3.38: Complete handling of category/Makefile; now compares
list of SUBDIRS against list of directories and complains about mismatches.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.pl32
2 files changed, 32 insertions, 4 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index 6884a977d9b..5f1f091aede 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.142 2002/11/23 01:07:31 schmonz Exp $
+# $NetBSD: Makefile,v 1.143 2002/12/10 12:42:40 wiz Exp $
#
-DISTNAME= pkglint-3.37
+DISTNAME= pkglint-3.38
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index e499cbc1456..76ea0a63754 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -12,7 +12,7 @@
# Freely redistributable. Absolutely no warranty.
#
# From Id: portlint.pl,v 1.64 1998/02/28 02:34:05 itojun Exp
-# $NetBSD: pkglint.pl,v 1.73 2002/11/14 04:01:56 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.74 2002/12/10 12:42:40 wiz Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by Hubert Feyrer <hubertf@netbsd.org>,
@@ -1511,6 +1511,9 @@ sub category_check {
local($lastsub) = "";
local($sub) = "";
local($contents);
+ local(@dirlist);
+ local(%alldirs);
+ local($i);
$contents = readmakefile("$portdir/$file") or
&perror("FATAL: can't read $portdir/$file") and return 0;
@@ -1520,9 +1523,19 @@ sub category_check {
if ($contents !~ /COMMENT=\s+\w/) {
&perror("FATAL: no COMMENT line in $file");
}
+
+ # get list of dirs to compare against
+ @dirlist=glob("*/");
+ foreach $i (@dirlist) {
+ # drop trailing slash and enter into hash
+ $i =~ s/\/$//;
+ $hash{$i} = 1;
+ }
+ # we expect the CVS dir to be here
+ $hash{CVS} = 0;
# remove comments
foreach $n (split "\n", $contents) {
- if ($n =~ /SUBDIR(\+*)=\s*(\S+)(\s*#.*|\s*)$/) {
+ if ($n =~ /^SUBDIR(\+*)=\s*(\S+)(\s*#.*|\s*)$/) {
$sub = $2;
if ($first == 0) {
if ($1 ne "+") {
@@ -1536,8 +1549,23 @@ sub category_check {
$first = 0;
}
$lastsub = $sub;
+ if ($hash{$sub} == 1) {
+ $hash{$sub} = 0;
+ }
+ else {
+ $hash{$sub} = -1;
+ }
}
}
+
+ foreach $i (sort(keys(%hash))) {
+ if ($hash{$i} gt 0) {
+ &perror("FATAL: directory $i not in Makefile");
+ }
+ elsif ($hash{$i} lt 0) {
+ &perror("FATAL: non-existing directory $i listed in Makefile");
+ }
+ }
}
sub TRUE {1;}