run_*_progress: fix error message when exec() failed

This commit is contained in:
Johannes 'josch' Schauer 2019-01-12 00:48:40 +01:00
parent a3f69f8874
commit 0345d30ae6
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -452,8 +452,9 @@ sub run_dpkg_progress {
my $fd = fileno $wfh;
# redirect dpkg's stderr to stdout so that we can capture it
open(STDERR, '>&', STDOUT);
exec { $args[0] } @args, "--status-fd=$fd", @debs;
die "cannot exec() dpkg";
my @execargs = (@args, "--status-fd=$fd", @debs);
exec { $args[0] } @execargs;
die 'cannot exec() ' . (join ' ', @execargs);
}
close $wfh;
@ -523,8 +524,9 @@ sub run_apt_progress {
my $fd = fileno $wfh;
# redirect apt's stderr to stdout so that we can capture it
open(STDERR, '>&', STDOUT);
exec { $args[0] } @args, "-oAPT::Status-Fd=$fd", @debs;
die "cannot exec apt-get update: $!";
my @execargs = (@args, "-oAPT::Status-Fd=$fd", @debs);
exec { $args[0] } @execargs;
die 'cannot exec() ' . (join ' ', @execargs);
}
close $wfh;