From 2990b88c8add53feb518dcc2e1f4e1b7ffe8a6b8 Mon Sep 17 00:00:00 2001 From: abs Date: Tue, 30 Sep 2003 16:09:50 +0000 Subject: Update pkglint to 3.62: lintpkgsrc - handle the buildlink include fest: - Using realpath() to fix exclude of duplicate includes speeds up 'lintpkgsrc -rp' on a PIII-500 from 40 minutes to 3 - Excluding buildlink[^/]*.mk files unless -d is specified further speeds up to just under 1 minute --- pkgtools/pkglint/Makefile | 4 ++-- pkgtools/pkglint/files/lintpkgsrc.pl | 27 ++++++++++++--------------- 2 files changed, 14 insertions(+), 17 deletions(-) (limited to 'pkgtools') diff --git a/pkgtools/pkglint/Makefile b/pkgtools/pkglint/Makefile index 7938ee5809d..c4f125fe06f 100644 --- a/pkgtools/pkglint/Makefile +++ b/pkgtools/pkglint/Makefile @@ -1,7 +1,7 @@ -# $NetBSD: Makefile,v 1.168 2003/09/21 20:32:35 wiz Exp $ +# $NetBSD: Makefile,v 1.169 2003/09/30 16:09:50 abs Exp $ # -DISTNAME= pkglint-3.61 +DISTNAME= pkglint-3.62 WRKSRC= ${WRKDIR} CATEGORIES= pkgtools devel MASTER_SITES= # empty diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index 3cbf5c4ab43..e0d4e65b7ce 100755 --- a/pkgtools/pkglint/files/lintpkgsrc.pl +++ b/pkgtools/pkglint/files/lintpkgsrc.pl @@ -1,6 +1,6 @@ #!@PREFIX@/bin/perl -# $NetBSD: lintpkgsrc.pl,v 1.82 2003/09/21 20:32:36 wiz Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.83 2003/09/30 16:09:50 abs Exp $ # Written by David Brownlee . # @@ -18,7 +18,7 @@ use locale; use strict; use Getopt::Std; use File::Find; -use Cwd; +use Cwd 'realpath', 'getcwd'; my( $pkglist, # list of Pkg packages $pkg_installver, # installed version of pkg_install pseudo-pkg $default_vars, # Set for Makefiles, inc PACKAGES & PKGSRCDIR @@ -873,31 +873,28 @@ sub parse_makefile_vars { $_ = $1; debug("$file: .include \"$_\"\n"); - if (m#/mk/bsd#) + if (m#/mk/bsd# || (!$opt{d} && m#/(buildlink[^/]*\.mk)#)) { debug("$file: .include skipped\n"); } else { - my($incfile) = ($_); + my($incfile) = $_; # Expand any simple vars in $incfile # $incfile = parse_expand_vars($incfile, \%vars); - # Handle relative path incfile - # if (substr($incfile, 0, 1) ne '/') - { - $incfile = "$CURDIR/$incfile"; - $NEWCURDIR = $incfile; - $NEWCURDIR =~ s#/[^/]*$##; - } - else - { - $NEWCURDIR = $CURDIR; - } + { $incfile = "$CURDIR/$incfile"; } + + $incfile = realpath($incfile); + if (!$incfiles{$incfile}) { + if ($opt{L}) + { print "inc $incfile\n"; } $incfiles{$incfile} = 1; + $NEWCURDIR = $incfile; + $NEWCURDIR =~ s#/[^/]*$##; if (!open(FILE, $incfile)) { verbose("Cannot open '$incfile' (from $file): $!\n");} else -- cgit v1.2.3