diff options
author | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:51:09 +0000 |
---|---|---|
committer | Thierry Vignaud <tv@mageia.org> | 2012-06-08 18:51:09 +0000 |
commit | 4953653249dde553842c915b161c1b64ed653ebd (patch) | |
tree | 9b076b3e9f55bc9c2a17e10c6ddb7a5c5a2fee74 | |
parent | 78c2ebcb2b939963f404d721abae0d0a7d959a49 (diff) | |
download | urpmi-4953653249dde553842c915b161c1b64ed653ebd.tar urpmi-4953653249dde553842c915b161c1b64ed653ebd.tar.gz urpmi-4953653249dde553842c915b161c1b64ed653ebd.tar.bz2 urpmi-4953653249dde553842c915b161c1b64ed653ebd.tar.xz urpmi-4953653249dde553842c915b161c1b64ed653ebd.zip |
(_download_callback) split it out of _download_packages()
-rw-r--r-- | urpm/main_loop.pm | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index a250c559..c8cc86ac 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -31,6 +31,14 @@ use urpm::get_pkgs; use urpm::signature; use urpm::util qw(difference2 find intersection member partition untaint); +sub _download_callback { + my ($urpm, $callbacks, $raw_msg, $msg) = @_; + if (my $download_errors = delete $urpm->{download_errors}) { + $raw_msg = join("\n", @$download_errors, ''); + } + $callbacks->{ask_yes_or_no}('', $raw_msg . "\n" . $msg . "\n" . N("Retry?")); +} + sub _download_packages { my ($urpm, $callbacks, $blists, $sources) = @_; my @error_sources; @@ -42,11 +50,7 @@ sub _download_packages { quiet => $options{verbose} < 0, callback => $callbacks->{trans_log}, ask_retry => !$urpm->{options}{auto} && ($callbacks->{ask_retry} || sub { - my ($raw_msg, $msg) = @_; - if (my $download_errors = delete $urpm->{download_errors}) { - $raw_msg = join("\n", @$download_errors, ''); - } - $callbacks->{ask_yes_or_no}('', $raw_msg . "\n" . $msg . "\n" . N("Retry?")); + _download_callback($urpm, $callbacks, @_); }), ); my @msgs; |