From 526afa76d1f7f3dcfe27bcbd5b4b1eb5351f30a0 Mon Sep 17 00:00:00 2001 From: Pascal Rigaux Date: Mon, 13 Nov 2006 12:13:06 +0000 Subject: - correctly cook args to sync_file() - util::cfg is not needed in urpm::download --- urpm.pm | 5 ++--- urpm/download.pm | 4 +--- 2 files changed, 3 insertions(+), 6 deletions(-) diff --git a/urpm.pm b/urpm.pm index 5b907716..502c70c4 100644 --- a/urpm.pm +++ b/urpm.pm @@ -69,9 +69,8 @@ sub sync_webfetch { push @{$files{$1}}, $_; } if ($files{removable} || $files{file}) { - eval { - sync_file($options, @{$files{removable} || []}, @{$files{file} || []}); - }; + my @l = map { analyse_url__file_if_local($_) } @{$files{removable} || []}, @{$files{file} || []}; + eval { sync_file($options, @l) }; $urpm->{fatal}(10, $@) if $@; delete @files{qw(removable file)}; } diff --git a/urpm/download.pm b/urpm/download.pm index 22720cfc..2a60a4eb 100644 --- a/urpm/download.pm +++ b/urpm/download.pm @@ -4,7 +4,6 @@ package urpm::download; use strict; use urpm::msg; -use urpm::cfg; use urpm::util; use Cwd; use Exporter; @@ -192,10 +191,9 @@ sub propagate_sync_callback { sub sync_file { my $options = shift; foreach (@_) { - my ($in) = m!^(?:removable[^:]*:/|file:/)(/.*)!; propagate_sync_callback($options, 'start', $_); require urpm::util; - urpm::util::copy($in || $_, ref($options) ? $options->{dir} : $options) + urpm::util::copy($_, ref($options) ? $options->{dir} : $options) or die N("copy failed"); propagate_sync_callback($options, 'end', $_); } -- cgit v1.2.1