diff options
author | eik <eik@FreeBSD.org> | 2004-05-18 01:09:01 +0800 |
---|---|---|
committer | eik <eik@FreeBSD.org> | 2004-05-18 01:09:01 +0800 |
commit | 1c3c9804ad24604f550ccb5086a2c8b523426d78 (patch) | |
tree | d46c9179bfbdc81505dd033326be41f02ce87379 /Tools/scripts | |
parent | 523aafd119b4ae451d965d97e6e0f3ad067e9ffc (diff) | |
download | freebsd-ports-gnome-1c3c9804ad24604f550ccb5086a2c8b523426d78.tar.gz freebsd-ports-gnome-1c3c9804ad24604f550ccb5086a2c8b523426d78.tar.zst freebsd-ports-gnome-1c3c9804ad24604f550ccb5086a2c8b523426d78.zip |
check only ports connected to the build.
Diffstat (limited to 'Tools/scripts')
-rwxr-xr-x | Tools/scripts/chkversion.pl | 47 |
1 files changed, 32 insertions, 15 deletions
diff --git a/Tools/scripts/chkversion.pl b/Tools/scripts/chkversion.pl index aa0f9481f058..ee048baeaf9e 100755 --- a/Tools/scripts/chkversion.pl +++ b/Tools/scripts/chkversion.pl @@ -30,7 +30,7 @@ # # $FreeBSD$ # -# MAINTAINER= eik@FreeBSD.org +# MAINTAINER= eik@FreeBSD.org # # PORTVERSION and PKGORIGIN auditing script # @@ -64,6 +64,7 @@ use Cwd 'abs_path'; my $portsdir = $ENV{PORTSDIR} ? $ENV{PORTSDIR} : '/usr/ports'; my $versiondir = $ENV{VERSIONDIR} ? $ENV{VERSIONDIR} : '/var/db/chkversion'; my $cvsblame = $ENV{CVSBLAME} ? 1 : 0; +my $allports = $ENV{ALLPORTS} ? 1 : 0; my $make = '/usr/bin/make'; my $cvs = '/usr/bin/cvs'; @@ -90,7 +91,7 @@ sub readfrom { my @childout = <CHILD>; close CHILD; - map { chomp } @childout; + map chomp, @childout; return wantarray ? @childout : $childout[0]; } @@ -116,8 +117,8 @@ sub wanted { $File::Find::prune = 1; } elsif ($File::Find::name =~ m"^$portsdir/([^/]+/[^/]+)$"os) { - my @makevar = readfrom $File::Find::name, $make, '-VPKGORIGIN', - '-VPKGNAME'; + my @makevar = readfrom $File::Find::name, + $make, '-VPKGORIGIN', '-VPKGNAME'; $pkgorigin{$1} = $makevar[0] if $makevar[0] && $1 ne $makevar[0]; @@ -128,7 +129,27 @@ sub wanted { } } -find(\&wanted, $portsdir); +if ($allports) { + find(\&wanted, $portsdir); +} +else { + my @categories = split ' ', readfrom $portsdir, $make, '-VSUBDIR'; + + foreach my $category (@categories) { + -f "$portsdir/$category/Makefile" || next; + my @ports = split ' ', + readfrom "$portsdir/$category", $make, '-VSUBDIR'; + foreach (map "$category/$_", @ports) { + -f "$portsdir/$_/Makefile" || next; + my @makevar = readfrom "$portsdir/$_", + $make, '-VPKGORIGIN', '-VPKGNAME'; + $pkgorigin{$_} = $makevar[0] + if $makevar[0] && $_ ne $makevar[0]; + $pkgname{$_} = $makevar[1] + if $makevar[1]; + } + } +} my %backwards; @@ -157,8 +178,8 @@ while (<VERSIONS>) { $newversion =~ s/^.*-//; $oldversion =~ s/^.*-//; - my $result = readfrom '', $pkg_version, '-t', $newversion, - $oldversion; + my $result = readfrom '', + $pkg_version, '-t', $newversion, $oldversion; if ($result eq '<') { $backwards{$origin} = "$pkgname{$origin} < $version"; $pkgname{$origin} = $version; @@ -187,8 +208,8 @@ sub blame { foreach (sort keys %{$ports}) { print "- $_: $ports->{$_}\n"; if ($cvsblame && -d "$portsdir/$_/CVS") { - my @cvslog = readfrom "$portsdir/$_", $cvs, '-R', 'log', '-N', - '-r.', 'Makefile'; + my @cvslog = readfrom "$portsdir/$_", + $cvs, '-R', 'log', '-N', '-r.', 'Makefile'; print " ", join("\n " , grep(/^-/ .. /^=/, @cvslog)), "\n\n"; } } @@ -200,12 +221,8 @@ blame "** The following ports have a wrong PKGORIGIN **\n\n" . " PKGORIGIN connects packaged or installed ports to the directory they\n" . " originated from. This is essential for tools like pkg_version or\n" - . " portupgrade to work correctly.\n" . "\n" - . " Wrong PKGORIGINs are often caused by a wrong order of CATEGORIES after\n" - . " a repocopy. While it is normal that ports are broken for a short period\n" - . " after every repocopy, note that they can be installed even when they are\n" - . " not yet connected to the build (via an entry in its category's Makefile),\n" - . " therefore it is important that these are fixed as soon as possible.\n", + . " portupgrade to work correctly. Wrong PKGORIGINs are often caused by a\n" + . " wrong order of CATEGORIES after a repocopy.\n", \%pkgorigin; blame |