diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-30 13:15:58 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2009-07-30 13:15:58 +0000 |
commit | acbc56d621004e5ea6588391f9822dfc4347a8fe (patch) | |
tree | fbbeadbe5a5f0533365f6fc91e1063a99ee00f36 /urpm/download.pm | |
parent | 0e0a78df556e80f468902e65c53ee2f38eaa3eae (diff) | |
download | urpmi-acbc56d621004e5ea6588391f9822dfc4347a8fe.tar urpmi-acbc56d621004e5ea6588391f9822dfc4347a8fe.tar.gz urpmi-acbc56d621004e5ea6588391f9822dfc4347a8fe.tar.bz2 urpmi-acbc56d621004e5ea6588391f9822dfc4347a8fe.tar.xz urpmi-acbc56d621004e5ea6588391f9822dfc4347a8fe.zip |
dudf patch from Olivier Rosello for the Mancoosi project
Diffstat (limited to 'urpm/download.pm')
-rw-r--r-- | urpm/download.pm | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/urpm/download.pm b/urpm/download.pm index a2669919..01f3644d 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -462,7 +462,6 @@ sub sync_curl { (map { m|/| ? ("-O", $_) : @{[]} } @other_files))) { my @l = (@ftp_files, @other_files); - my ($buf, $file); $buf = ''; my $cmd = join(" ", map { "'$_'" } "/usr/bin/curl", "-q", # don't read .curlrc; some toggle options might interfer ($options->{'limit-rate'} ? ("--limit-rate", $options->{'limit-rate'}) : ()), @@ -481,6 +480,17 @@ sub sync_curl { "--stderr", "-", # redirect everything to stdout @all_files); $options->{debug} and $options->{debug}($cmd); + _curl_action($cmd,$options,@l,"download",$cwd); + } else { + chdir $cwd; + } + +} + +sub _curl_action { + my ($cmd, $options, @l, $updown, $cwd) = @_; + + my ($buf, $file); $buf = ''; my $curl_pid = open(my $curl, "$cmd |"); local $/ = \1; #- read input by only one char, this is slow but very nice (and it works!). local $_; @@ -497,7 +507,7 @@ sub sync_curl { if (propagate_sync_callback($options, 'progress', $file, $percent, $total, $eta, $speed) eq 'canceled') { kill 15, $curl_pid; close $curl; - die N("curl failed: download canceled\n"); + die N("curl failed: ".$updown." canceled\n"); } #- this checks that download has actually started if ($_ eq "\n" @@ -519,9 +529,6 @@ sub sync_curl { } chdir $cwd; close $curl or _error('curl'); - } else { - chdir $cwd; - } } sub _calc_limit_rate { |