From c40838c088c98ecf2472062edd2d73a134caf690 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 9 Jan 2003 12:20:26 +0000 Subject: grpmi: allow to retry downloads --- grpmi/grpmi.pl | 16 ++++++++++------ rpmdrake.spec | 1 + 2 files changed, 11 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&"; } } diff --git a/rpmdrake.spec b/rpmdrake.spec index e2bc6d68..9c9deac9 100644 --- a/rpmdrake.spec +++ b/rpmdrake.spec @@ -119,6 +119,7 @@ rm -rf $RPM_BUILD_ROOT - grpmi: - verify all signatures at the end of all downloads - allow to say "yes to all" to the signatures questions + - allow to retry downloads * Wed Jan 8 2003 Guillaume Cottenceau 2.1-1mdk - gtk2 (possibly contains important breakages, use with care) -- cgit v1.2.1