summaryrefslogtreecommitdiff
path: root/pkgtools
diff options
context:
space:
mode:
authorwiz <wiz>2002-09-24 14:01:37 +0000
committerwiz <wiz>2002-09-24 14:01:37 +0000
commitbb5a20f2c0f7171d59c502869e97b8883ea192ba (patch)
treef1a7c93c14db5413e35b1cbafa7ff8a58c287250 /pkgtools
parent39ae5040239ba675e7434ffa684a882bf0db0467 (diff)
downloadpkgsrc-bb5a20f2c0f7171d59c502869e97b8883ea192ba.tar.gz
Update to 3.34: Can now also be run in Category directories and checks
correct sorting order of SUBDIR entries.
Diffstat (limited to 'pkgtools')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.pl45
2 files changed, 45 insertions, 4 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index dba88dc9d63..d092c7bf2c8 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.137 2002/09/24 12:34:21 wiz Exp $
+# $NetBSD: Makefile,v 1.138 2002/09/24 14:01:37 wiz Exp $
#
-DISTNAME= pkglint-3.33
+DISTNAME= pkglint-3.34
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 5c468269915..e8b88b5729a 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.70 2002/09/24 12:34:22 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.71 2002/09/24 14:01:38 wiz Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by Hubert Feyrer <hubertf@netbsd.org>,
@@ -76,6 +76,12 @@ if (! -d $portdir) {
exit 1;
}
+if (-e <$portdir/../Packages.txt>) {
+ print "OK: checking category Makefile.\n" if ($verbose);
+ &category_check;
+ exit 0;
+}
+
#
# variables for global checks.
#
@@ -657,7 +663,7 @@ sub checkmakefile {
$i = "\n" x ($contblank + 2);
if ($whole =~ /$i/) {
&perror("FATAL: contiguous blank lines (> $contblank lines) found ".
- "in $file at line " . int(split(/\n/, $`)) . ".");
+ "in $file at line " . int(@_ = split(/\n/, $`)) . ".");
}
#
@@ -1499,4 +1505,39 @@ sub is_predefined {
undef;
}
+sub category_check {
+ local($file) = "Makefile";
+ local($first) = 1;
+ local($lastsub) = "";
+ local($sub) = "";
+ local($contents);
+
+ $contents = readmakefile($file) or
+ &perror("FATAL: can't read $portdir/$file") and return 0;
+ if ($contents !~ /#(\s+)\$$rcsidstr([^\$]*)\$/) {
+ &perror("FATAL: no \$$rcsidstr\$ line in $file");
+ }
+ if ($contents !~ /COMMENT=\s+\w/) {
+ &perror("FATAL: no COMMENT line in $file");
+ }
+ # remove comments
+ foreach $n (split "\n", $contents) {
+ if ($n =~ /SUBDIR(\+*)=\s*(\S+)(\s*#.*|\s*)$/) {
+ $sub = $2;
+ if ($first == 0) {
+ if ($1 ne "+") {
+ &perror("FATAL: use SUBDIR+=, not SUBDIR$1=");
+ }
+ if ($lastsub ge $sub) {
+ &perror("FATAL: $sub should come before $lastsub");
+ }
+ }
+ else {
+ $first = 0;
+ }
+ $lastsub = $sub;
+ }
+ }
+}
+
sub TRUE {1;}