Commit 0563a37e authored by tous's avatar tous

Converte tails-iuk-get-target-file | zenity pipeline to the start / pump / finish interface

parent c2263126
......@@ -585,16 +585,22 @@ method get_target_files (HashRef $upgrade_path, CodeRef $url_transform, AbsDir $
$exit_code = $?;
}
else {
local $SIG{HUP} = sub {
local $SIG{PIPE} = sub {
$self->cancel_download;
exit(0);
};
IPC::Run::run \@cmd, '2>', \$stderr,
'|', [qw{zenity --progress --percentage=0 --auto-close
--auto-kill}, '--title', $title, '--text', $info]
or $success = 0;
$exit_code = $?;
}
my ($download_h,$zenity_h,$download_out,$download_in,$zenity_out);
$download_h = IPC::Run::start \@cmd,\$download_in,\$download_out;
$zenity_h = IPC::Run::start [qw{zenity --progress --percentage=0 --auto-close}, '--title', $title, '--text', $info],\$download_out,\$zenity_out;
while ($download_h->pumpable) {
$download_h->pump;
$zenity_h->pump_nb;
}
$zenity_h->finish;
$success = $download_h->finish;
$exit_code = $download_h->result;
}
$success or $self->fatal(
errf("<b>%{error_msg}s</b>\n\n%{details}s",
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment