Tools/scripts/bump_revision.pl: Fix a few issues

- When using a non-default ports tree (-p PATH),
  strip that from the requisite origins, too.
- Fix the counters when multiple ports are given on the command line,
  i. e. we are bumping depends if more requisites are updated at once.
This commit is contained in:
Matthias Andree 2020-01-05 02:05:23 +00:00
parent 58e5e2482e
commit c11266721a
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=522078

View file

@ -160,8 +160,8 @@ my %index = ();
$port = $b[-2]."/".$b[-1];
@{ $index{$port} }{'portname', 'portnameversion', 'portdir', 'comment', 'deps'}
= ($b[-1], $a[0], $a[1], $a[3], ());
@{ $index{$port} }{'portname', 'portnameversion', 'origin', 'comment', 'deps'}
= ($b[-1], $a[0], $port, $a[3], ());
if ($a[8]) {
@b = split(" ", $a[8]);
@ -202,13 +202,15 @@ foreach my $PORT (@ARGV) {
#
{
print "Searching for ports depending on $PORT\n";
my $count = 0;
foreach my $p (keys(%index)) {
if (defined $index{$p}{'deps'}{$PORTNAMEVERSION}) {
$DEPPORTS{$p} = 1;
++$count;
}
}
print "- Found ", scalar keys(%DEPPORTS), " ports depending on $PORT.\n";
print "- Found $count ports depending on $PORT.\n";
}
}
@ -221,7 +223,7 @@ sub direct_dependency($@) {
my @lines = <F>;
chomp @lines;
my $deps = join(" ", @lines);
my %deps = map { $_ =~ s[/usr/ports/][]; ($_ => 1) } split " ", $deps;
my %deps = map { $_ =~ s[/usr/ports/][]; $_ =~ s[$portsdir/][]; ($_ => 1) } split " ", $deps;
if ($!) { die "cannot read depends from make: $!"; }
close F or die "cannot read depends from make: $!";
my $required = grep { $_ } map { defined $deps{$_} } @requisites;