prt-auf: fix the 'dependent' command to handle plus signs in a port name
This commit is contained in:
parent
af7d4a6e65
commit
8338d5f131
@ -504,6 +504,7 @@ sub list_ports {
|
||||
if (($subset eq "dependent") and (! find_port_by_name($seed,1,1,0))) {
|
||||
print "$seed not found in the ports tree.\n"; return;
|
||||
}
|
||||
$seed =~ s/\+/\\\+/g; # workaround for any port with a plus sign in its name
|
||||
|
||||
our @searchspace=(($subset eq "orphans") or ($odepends{all}==0)) ?
|
||||
keys %V_INST : keys %DEPENDS;
|
||||
@ -645,6 +646,7 @@ sub deporder {
|
||||
|
||||
sub up_inst { # returns scalar references to five arrays
|
||||
my $type=shift; my @requested=@_; my %EXEMPT; my %WANTED; my %pdirs;
|
||||
my %builtpkg; my %mkcmd; my %addcmd; my %status; my %logfile; my %pvars;
|
||||
my $PKGMK=$opkg{makecommand}; my $PKGADD=$opkg{addcommand};
|
||||
my $SUDO="/usr/bin/doas"; my $FAKEROOT="/usr/bin/fakeroot";
|
||||
|
||||
@ -669,7 +671,6 @@ sub up_inst { # returns scalar references to five arrays
|
||||
# first determine the directories from which pkgmk must be called,
|
||||
# the package that will appear after a successful build,
|
||||
# and where to save the build log.
|
||||
my %builtpkg; my %mkcmd; my %addcmd; my %status; my %logfile; my %pvars;
|
||||
my ($COMPRESSION, $PKG_DIR) = parse_pkgmk_conf();
|
||||
foreach my $t (@targets) {
|
||||
$opkg{$t} = $opkg{margs}; $pvars{'%n'}=$t;
|
||||
@ -707,7 +708,8 @@ sub up_inst { # returns scalar references to five arrays
|
||||
}
|
||||
($opkg{test} eq "no") ? chdir $pdirs{$t} : print "cd $pdirs{$t}\n";
|
||||
($opkg{test} eq "no") ? system("$mkcmd{$t}") : print "$mkcmd{$t}\n";
|
||||
$status{$t} .= ( $?>>8 == 0 ) ? "build ok. " : "build failed. ";
|
||||
$status{$t} .= ( $?>>8 == 0 ) ? "build ok. " : "build failed. " unless ($logfile{$t});
|
||||
$status{$t} .= (! log_failure($logfile{$t})) ? "build ok. " : "build failed. " if ($logfile{$t});
|
||||
$status{$t} = ( $mkcmd{$t} =~ /skipped/ ) ? "build skipped. " : $status{$t};
|
||||
if (($status{$t} =~ /build ok/) or ($mkcmd{$t} =~ /up to date/)) {
|
||||
$addcmd{$t} =~ s/ -u / / if (port_diff("utd",$t)<0);
|
||||
@ -724,6 +726,13 @@ sub up_inst { # returns scalar references to five arrays
|
||||
last if (($status{$t} =~ /failed/) and ($type eq "grpinst"));
|
||||
}
|
||||
|
||||
sub log_failure {
|
||||
my $lf=shift; local $/=""; my $failed=0;
|
||||
open(FH,$lf) or return 0;
|
||||
while (<FH>) { $failed=1 if m/ERROR: Unsuccessful build!$/; }
|
||||
close(FH); return $failed;
|
||||
}
|
||||
|
||||
my @ok = grep { $status{$_} =~ /pkgadd ok/ } @targets;
|
||||
my @ok_pre = grep { $status{$_} =~ /pre-install ok/ } @targets;
|
||||
my @ok_post = grep { $status{$_} =~ /post-install ok/ } @ok;
|
||||
|
Loading…
x
Reference in New Issue
Block a user