summaryrefslogtreecommitdiff
path: root/pkgtools/pkglint
diff options
context:
space:
mode:
authorwiz <wiz>2003-03-28 20:22:22 +0000
committerwiz <wiz>2003-03-28 20:22:22 +0000
commitada411a48533ed85d8b13ac79b61d97c78311e40 (patch)
treef58d86601840094f39b479017e3e9ce986b196d2 /pkgtools/pkglint
parentd0718101c44a067d3646e9e8bd04cab7efdb357e (diff)
downloadpkgsrc-ada411a48533ed85d8b13ac79b61d97c78311e40.tar.gz
Update to 3.48: Avoid including the same buildlink2 files over
and over and over and over again. Among others, this makes pkglint work again for x11/gnomepanel.
Diffstat (limited to 'pkgtools/pkglint')
-rw-r--r--pkgtools/pkglint/Makefile4
-rw-r--r--pkgtools/pkglint/files/pkglint.pl30
2 files changed, 31 insertions, 3 deletions
diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile
index a6838b38027..000a9d7eff8 100644
--- a/pkgtools/pkglint/Makefile
+++ b/pkgtools/pkglint/Makefile
@@ -1,7 +1,7 @@
-# $NetBSD: Makefile,v 1.153 2003/03/27 05:16:11 atatat Exp $
+# $NetBSD: Makefile,v 1.154 2003/03/28 20:22:22 wiz Exp $
#
-DISTNAME= pkglint-3.47
+DISTNAME= pkglint-3.48
CATEGORIES= pkgtools devel
MASTER_SITES= # empty
DISTFILES= # empty
diff --git a/pkgtools/pkglint/files/pkglint.pl b/pkgtools/pkglint/files/pkglint.pl
index 60c8fd9bf40..99380c2384e 100644
--- a/pkgtools/pkglint/files/pkglint.pl
+++ b/pkgtools/pkglint/files/pkglint.pl
@@ -11,7 +11,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.82 2003/02/01 13:37:33 wiz Exp $
+# $NetBSD: pkglint.pl,v 1.83 2003/03/28 20:22:23 wiz Exp $
#
# This version contains lots of changes necessary for NetBSD packages
# done by Hubert Feyrer <hubertf@netbsd.org>,
@@ -29,6 +29,7 @@ $verbose = $newpkg = 0; # -vN
$showmakefile = 0; # -I
$contblank = 1;
$portdir = '.';
+%definesfound = ();
# default settings for NetBSD
$portsdir = '@PORTSDIR@';
@@ -603,6 +604,7 @@ sub readmakefile {
local $includefile;
local $dirname;
local $savedln;
+ local $level;
local $_;
my $handle = new FileHandle;
@@ -619,6 +621,32 @@ sub readmakefile {
&perror("WARN: $file $.: use tab (not spaces) to".
" make indentation.");
}
+ if ($_ =~ /^\.\s*if\s+!defined\s*\((\w+)\)/) {
+ if ($definesfound{$1}) {
+ $level = 1;
+ print("OK: omitting contents of !defined($1)\n") if ($verbose);
+ $contents .= "# omitted inclusion for !defined($1) here\n";
+ while (<$handle>) {
+ if ($_ =~ /^\.\s*if\s+/) {
+ $level++;
+ }
+ elsif ($_ =~ /^\.\s*endif\s+/) {
+ $level--;
+ }
+ if ($level eq 0) {
+ break;
+ }
+ }
+ if ($level > 0) {
+ &perror("WARN: missing .endif.");
+ }
+ next;
+ }
+ else {
+ print("OK: defining $1\n") if $verbose;
+ $definesfound{$1} = true;
+ }
+ }
# try to get any included file
if ($_ =~ /^.include\s+([^\n]+)\n/) {
$includefile = $1;