summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.org>2004-01-30 19:16:15 +0000
committerOlivier Blin <oblin@mandriva.org>2004-01-30 19:16:15 +0000
commitb5df9cfc8172135b17fd0bf3257ab3c7fece8edb (patch)
tree7c6a46805f974bfb983c605538cf3a4c526ebd58
parentcbcf6970fd363965fbfea04f7c3f987a41244750 (diff)
downloadurpmi-b5df9cfc8172135b17fd0bf3257ab3c7fece8edb.tar
urpmi-b5df9cfc8172135b17fd0bf3257ab3c7fece8edb.tar.gz
urpmi-b5df9cfc8172135b17fd0bf3257ab3c7fece8edb.tar.bz2
urpmi-b5df9cfc8172135b17fd0bf3257ab3c7fece8edb.tar.xz
urpmi-b5df9cfc8172135b17fd0bf3257ab3c7fece8edb.zip
download resuming options
-rw-r--r--urpm.pm5
-rwxr-xr-xurpmi4
-rw-r--r--urpmi.spec7
3 files changed, 14 insertions, 2 deletions
diff --git a/urpm.pm b/urpm.pm
index 7b297578..2788d9f6 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -199,6 +199,7 @@ sub sync_wget {
my ($buf, $total, $file) = ('', undef, undef);
my $wget_pid = open WGET, join(" ", map { "'$_'" } "/usr/bin/wget",
(ref($options) && $options->{limit_rate} ? "--limit-rate=$options->{limit_rate}" : ()),
+ (ref($options) && $options->{resume} ? "--continue" : ()),
(ref($options) && $options->{proxy} ? set_proxy({ type => "wget", proxy => $options->{proxy} }) : ()),
(ref($options) && $options->{callback} ? ("--progress=bar:force", "-o", "-") :
ref($options) && $options->{quiet} ? "-q" : @{[]}),
@@ -300,6 +301,7 @@ sub sync_curl {
my ($buf, $file) = ('', undef);
my $curl_pid = open CURL, join(" ", map { "'$_'" } "/usr/bin/curl",
(ref($options) && $options->{limit_rate} ? ("--limit-rate", $options->{limit_rate}) : ()),
+ (ref($options) && $options->{resume} ? ("--continue-at", "-") : ()),
(ref($options) && $options->{proxy} ? set_proxy({ type => "curl", proxy => $options->{proxy} }) : ()),
(ref($options) && $options->{quiet} && !$options->{verbose} ? "-s" : @{[]}),
"-k", `curl -h` =~ /location-trusted/ ? "--location-trusted" : @{[]},
@@ -477,7 +479,7 @@ sub read_config {
$_ eq '}' and last;
#- check for boolean variables first, and after that valued variables.
my ($no, $k, $v);
- if (($no, $k, $v) = /^(no-)?(verify-rpm|fuzzy|keep|auto|allow-(?:force|nodeps)|(?:pre|post)-clean|excludedocs|compress)(?:\s*:\s*(.*))?$/) {
+ if (($no, $k, $v) = /^(no-)?(verify-rpm|fuzzy|allow-(?:force|nodeps)|(?:pre|post)-clean|excludedocs|compress|keep|auto|resume)(?:\s*:\s*(.*))?$/) {
unless (exists($urpm->{options}{$k})) {
$urpm->{options}{$k} = $v eq '' || $v =~ /^(yes|on|1)$/i || 0;
$no and $urpm->{options}{$k} = ! $urpm->{options}{$k} || 0;
@@ -2955,6 +2957,7 @@ sub download_packages_of_distant_media {
quiet => 0,
verbose => $options{verbose},
limit_rate => $options{limit_rate},
+ resume => $options{resume},
compress => $options{compress},
callback => $options{callback},
proxy => $urpm->{proxy} },
diff --git a/urpmi b/urpmi
index d95cf2cd..e85a2baa 100755
--- a/urpmi
+++ b/urpmi
@@ -106,6 +106,8 @@ usage:
") . N(" --wget - use wget to retrieve distant files.
") . N(" --curl - use curl to retrieve distant files.
") . N(" --limit-rate - limit the download speed.
+") . N(" --resume - resume transfer of partially-downloaded files
+ (--no-resume disables it, default is disabled).
") . N(" --proxy - use specified HTTP proxy, the port number is assumed
to be 1080 by default (format is <proxyhost[:port]>).
") . N(" --proxy-user - specify user and password to use for proxy
@@ -180,6 +182,7 @@ while (defined($_ = shift @argv)) {
/^--wget$/ and do { $urpm->{options}{downloader} = 'wget'; next };
/^--curl$/ and do { $urpm->{options}{downloader} = 'curl'; next };
/^--limit-rate$/ and do { push @nextargv, \$urpm->{options}{'limit-rate'}; next };
+ /^--(no-)?resume$/ and do { $urpm->{options}{'resume'} = !$1; next };
/^--proxy$/ and do {
my ($proxy, $port) = ($_ = shift @argv) =~ m,^(?:http://)?([^:]+(:\d+)?)/*$, or
die N("bad proxy declaration on command line\n");
@@ -580,6 +583,7 @@ foreach my $set (@{$state->{transaction} || []}) {
verbose => $verbose > 0,
limit_rate => $urpm->{options}{'limit-rate'},
compress => $urpm->{options}{compress},
+ resume => $urpm->{options}{'resume'},
force_local => 1,
callback => sub {
my ($mode, $file, $percent, $total, $eta, $speed) = @_;
diff --git a/urpmi.spec b/urpmi.spec
index df3dad32..2786d71f 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -7,7 +7,7 @@
##################################################################
%define name urpmi
-%define version 4.4.4
+%define version 4.4.5
%define release 1mdk
%define group %(perl -e 'printf "%%s\\n", "%_vendor" =~ /mandrake/i ? "System/Configuration/Packaging" : "System Environment/Base"')
@@ -236,6 +236,11 @@ $urpm->update_media(nolock => 1, nopubkey => 1);
%{compat_perl_vendorlib}/urpm/parallel_ssh.pm
%changelog
+* Fri Jan 30 2004 Olivier Blin <blino@mandrake.org> 4.4.5-1mdk
+- add --resume and --no-resume options in urpmi
+ (to resume transfer of partially-downloaded files)
+- add resume option in global config section
+
* Wed Jan 28 2004 Olivier Blin <blino@mandrake.org> 4.4.4-1mdk
- fix --wget and --curl in urpmi.update