diff options
-rw-r--r-- | urpm.pm | 5 | ||||
-rwxr-xr-x | urpmi | 4 | ||||
-rw-r--r-- | urpmi.spec | 7 |
3 files changed, 14 insertions, 2 deletions
@@ -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} }, @@ -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) = @_; @@ -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 |