From 477778d02536da8717718777188125ae5e603f50 Mon Sep 17 00:00:00 2001 From: wiz Date: Fri, 28 Mar 2003 20:22:22 +0000 Subject: 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. --- pkgtools/pkglint/Makefile | 4 ++-- pkgtools/pkglint/files/pkglint.pl | 30 +++++++++++++++++++++++++++++- 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 , @@ -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; -- cgit v1.2.3