diff options
author | abs <abs> | 2002-01-03 11:04:49 +0000 |
---|---|---|
committer | abs <abs> | 2002-01-03 11:04:49 +0000 |
commit | ce0cf922c2d159c37a09667cd377591555762d5a (patch) | |
tree | 2533ca2388b31e4dc133678b727d19a6f97398e3 /pkgtools/pkglint/files | |
parent | f88604d9d807ca2ed96bd2561af94bd29945498d (diff) | |
download | pkgsrc-ce0cf922c2d159c37a09667cd377591555762d5a.tar.gz |
Updated pkglint to 3.21
- lintpkgsrc - fixed -p to handle relative symlinks and symlink loops
Diffstat (limited to 'pkgtools/pkglint/files')
-rwxr-xr-x | pkgtools/pkglint/files/lintpkgsrc.pl | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/pkgtools/pkglint/files/lintpkgsrc.pl b/pkgtools/pkglint/files/lintpkgsrc.pl index 61eccafad94..447df03e641 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.64 2001/12/27 19:13:14 abs Exp $ +# $NetBSD: lintpkgsrc.pl,v 1.65 2002/01/03 11:04:50 abs Exp $ # Written by David Brownlee <abs@netbsd.org>. # @@ -24,6 +24,7 @@ my( $pkglist, # list of Pkg packages %vuln, # vulnerability data @matched_prebuiltpackages,# List of obsolete prebuilt package paths @prebuilt_pkgdirs, # Use to follow symlinks in prebuilt pkgdirs + %prebuilt_pkgdir_cache, # To avoid symlink loops in prebuilt_pkgdirs ); $ENV{PATH} .= ':/usr/sbin'; @@ -118,6 +119,7 @@ if ($opt{D} && @ARGV) if ($opt{p} || $opt{O} || $opt{R}) { scan_pkgsrc_makefiles($pkgsrcdir); } @prebuilt_pkgdirs = ($default_vars->{PACKAGES}); + %prebuilt_pkgdir_cache = (); while (@prebuilt_pkgdirs) { find(\&check_prebuilt_packages, shift @prebuilt_pkgdirs); } if ($opt{r}) @@ -293,8 +295,20 @@ sub check_prebuilt_packages } } - elsif (-l $_ && -d $_) - { push(@prebuilt_pkgdirs, readlink($_)); } + elsif (-d $_) + { + if ($prebuilt_pkgdir_cache{"$File::Find::dir/$_"}) + { $File::Find::prune = 1; return; } + $prebuilt_pkgdir_cache{"$File::Find::dir/$_"} = 1; + if (-l $_) + { + my($dest) = readlink($_); + if (substr($dest, 0, 1) ne '/') + { $dest = "$File::Find::dir/$dest"; } + if (!$prebuilt_pkgdir_cache{$dest}) + { push(@prebuilt_pkgdirs, $dest); } + } + } } # Dewey decimal verson number matching - or thereabouts |