aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-11-24 09:22:26 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2004-11-24 09:22:26 +0000
commitaf7753ca98bfe93b37c6945fa316660a31bdf3a5 (patch)
tree2d52c5b3911e8a8e43165a0e5e3fd87637ce584a
parentf24c39c092bc521db9d6784e638e89c620061993 (diff)
downloadrpmdrake-af7753ca98bfe93b37c6945fa316660a31bdf3a5.tar
rpmdrake-af7753ca98bfe93b37c6945fa316660a31bdf3a5.tar.gz
rpmdrake-af7753ca98bfe93b37c6945fa316660a31bdf3a5.tar.bz2
rpmdrake-af7753ca98bfe93b37c6945fa316660a31bdf3a5.tar.xz
rpmdrake-af7753ca98bfe93b37c6945fa316660a31bdf3a5.zip
Make rpmdrake honor limit-rate, compress and resume options when downloading
-rwxr-xr-xrpmdrake48
1 files changed, 29 insertions, 19 deletions
diff --git a/rpmdrake b/rpmdrake
index 548ec608..d187aea2 100755
--- a/rpmdrake
+++ b/rpmdrake
@@ -1324,25 +1324,35 @@ sub perform_installation { #- (partially) duplicated from /usr/sbin/urpmi :-(
gurpm::init(N("Package installation..."), N("Initializing..."), transient => $w->{rwindow});
my $distant_progress;
my $canceled;
- my %sources = $urpm->download_source_packages($local_sources, $list, force_local => 1,
- ask_for_medium => sub {
- interactive_msg_(N("Change medium"),
- N("Please insert the medium named \"%s\" on device [%s]", @_),
- yesno => 1, text => { no => N("Cancel"), yes => N("Ok"), }) },
- callback => sub {
- my ($mode, $file, $percent) = @_;
- if ($mode eq 'start') {
- gurpm::label(N("Downloading package `%s' (%s/%s)...",
- basename($file), ++$distant_progress, $distant_number));
- gurpm::validate_cancel(but(N("Cancel")), sub { $canceled = 1 });
- } elsif ($mode eq 'progress') {
- gurpm::progress($percent/100);
- } elsif ($mode eq 'end') {
- gurpm::progress(1);
- gurpm::invalidate_cancel();
- }
- $canceled and return 'canceled';
- });
+ my %sources = $urpm->download_source_packages(
+ $local_sources,
+ $list,
+ force_local => 1,
+ ask_for_medium => sub {
+ interactive_msg_(
+ N("Change medium"),
+ N("Please insert the medium named \"%s\" on device [%s]", @_),
+ yesno => 1, text => { no => N("Cancel"), yes => N("Ok") },
+ );
+ },
+ callback => sub {
+ my ($mode, $file, $percent) = @_;
+ if ($mode eq 'start') {
+ gurpm::label(N("Downloading package `%s' (%s/%s)...",
+ basename($file), ++$distant_progress, $distant_number));
+ gurpm::validate_cancel(but(N("Cancel")), sub { $canceled = 1 });
+ } elsif ($mode eq 'progress') {
+ gurpm::progress($percent/100);
+ } elsif ($mode eq 'end') {
+ gurpm::progress(1);
+ gurpm::invalidate_cancel();
+ }
+ $canceled and return 'canceled';
+ },
+ limit_rate => $urpm->{options}{'limit-rate'},
+ compress => $urpm->{options}{compress},
+ resume => $urpm->{options}{resume},
+ );
$canceled and goto return_with_error;
gurpm::invalidate_cancel_forever();