aboutsummaryrefslogtreecommitdiffstats
path: root/grpmi/grpmi.pl
diff options
context:
space:
mode:
authorGuillaume Cottenceau <gc@mandriva.com>2003-01-09 12:20:26 +0000
committerGuillaume Cottenceau <gc@mandriva.com>2003-01-09 12:20:26 +0000
commitc40838c088c98ecf2472062edd2d73a134caf690 (patch)
tree7d6084ea0a0b017c4b0d711d7499c374b7f1a7be /grpmi/grpmi.pl
parent1fa203d360e8fcb59b7a527dbaa1987ca7d95f5d (diff)
downloadrpmdrake-c40838c088c98ecf2472062edd2d73a134caf690.tar
rpmdrake-c40838c088c98ecf2472062edd2d73a134caf690.tar.gz
rpmdrake-c40838c088c98ecf2472062edd2d73a134caf690.tar.bz2
rpmdrake-c40838c088c98ecf2472062edd2d73a134caf690.tar.xz
rpmdrake-c40838c088c98ecf2472062edd2d73a134caf690.zip
grpmi: allow to retry downloads
Diffstat (limited to 'grpmi/grpmi.pl')
-rwxr-xr-xgrpmi/grpmi.pl16
1 files changed, 10 insertions, 6 deletions
diff --git a/grpmi/grpmi.pl b/grpmi/grpmi.pl
index 6d8745d5..848039fc 100755
--- a/grpmi/grpmi.pl
+++ b/grpmi/grpmi.pl
@@ -98,20 +98,24 @@ my $download_progress;
foreach my $arg (@ARGV) {
if ($arg =~ m,$url_regexp,) {
$download_progress++;
- $label->set(_("Downloading package `%s' (%s/%s)...", basename($arg), $download_progress, $nb_downloads));
+ my $url = $arg;
+ $arg = "$cache_location/" . basename($url);
+ retry_download:
+ $label->set(_("Downloading package `%s' (%s/%s)...", basename($url), $download_progress, $nb_downloads));
select(undef, undef, undef, 0.1); $mainw->flush; #- hackish :-(
- my $res = curl_download::download($arg, $cache_location,
+ my $res = curl_download::download($url, $cache_location,
sub { $_[0] and $progressbar->set_fraction($_[1]/$_[0]); $mainw->flush });
- my $url = $arg;
- $arg = "$cache_location/" . basename($arg);
if ($res) {
- interactive_msg(_("Error during download"),
+ my $results = interactive_msg(_("Error during download"),
_("There was an error downloading package:
%s
Error: %s
-Do you want to continue (skipping this package)?", $url, $res), 1) or goto cleanup;
+Do you want to continue (skipping this package)?", $url, $res),
+ [ _("Yes"), _("No"), _("Retry download") ]);
+ $results eq _("No") and goto cleanup;
+ $results eq _("Retry download") and goto retry_download;
$arg = "-skipped&$arg&";
}
}