support for symlinked portsdir (but no other symlinks in the ports tree)

chkversion: support for CVS blame with env CVSBLAME=yes
This commit is contained in:
Oliver Eikemeier 2004-05-14 21:07:39 +00:00
parent 1facd41b76
commit 1af7a456da
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=109168
2 changed files with 19 additions and 14 deletions

View File

@ -36,11 +36,10 @@
# Clement Laforet.
#
use strict;
use File::Find;
require 5.005;
use strict;
use File::Find;
use Cwd 'abs_path';
my $portsdir = $ENV{PORTSDIR} ? $ENV{PORTSDIR} : '/usr/ports';
my $cvsroot = $ENV{CVSROOT} ? $ENV{CVSROOT} : '/home/ncvs/CVSROOT-ports';
@ -48,6 +47,7 @@ my @excludes = $ENV{EXCLUDE} ? split(' ', $ENV{EXCLUDE}) : ('local', 'rookies')
-d "$portsdir" or die "Can't find ports tree at $portsdir.\n";
-f "$cvsroot/modules" or die "Can't read modules file $cvsroot/modules.\n";
$portsdir = abs_path($portsdir);
my %ports = ('ports' => 1);

View File

@ -58,15 +58,14 @@
# if you can spare the time.
#
use strict;
use File::Find;
require 5.005;
use strict;
use File::Find;
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 $pkg_version =
-x '/usr/local/sbin/pkg_version'
@ -74,12 +73,13 @@ my $pkg_version =
: '/usr/sbin/pkg_version';
-d "$portsdir" or die "Can't find ports tree at $portsdir.\n";
$portsdir = abs_path($portsdir);
my $useindex = !-w "$versiondir";
my $versionfile =
$useindex
? "$portsdir/`cd $portsdir; make -VINDEXFILE`"
? "$portsdir/".`cd $portsdir; make -VINDEXFILE`
: "$versiondir/VERSIONS";
chomp $versionfile;
@ -105,7 +105,6 @@ find(\&wanted, $portsdir);
my %backwards;
open VERSIONS, "<$versionfile";
while (<VERSIONS>) {
@ -148,8 +147,14 @@ if (!$useindex) {
close VERSIONS;
}
print join("\n - ",
"Package versions going backwards:",
map("$_: $backwards{$_}", sort keys %backwards)),
"\n"
if %backwards;
if (%backwards) {
print "Package versions going backwards:\n";
foreach (sort keys %backwards) {
print " - $_: $backwards{$_}\n";
if ($cvsblame && -d "$portsdir/$_/CVS") {
my @cvslog = `cd "$portsdir/$_"; cvs -R log -N -r. Makefile`;
print map "\t" . $_, grep /^-/ .. /^=/, @cvslog;
print "\n";
}
}
}