From 64f60e96cd8b895cfd908d030d5e6d482b53b98f Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Thu, 15 Oct 2009 17:12:03 +0000 Subject: allow to define the cache directory for RPMs when setting --download-all --- urpm/args.pm | 3 +-- urpm/main_loop.pm | 7 ++++++- 2 files changed, 7 insertions(+), 3 deletions(-) (limited to 'urpm') diff --git a/urpm/args.pm b/urpm/args.pm index d9e26718..e2a0751f 100644 --- a/urpm/args.pm +++ b/urpm/args.pm @@ -130,8 +130,7 @@ my %options_spec = ( 'parallel=s' => \$::parallel, 'metalink!' => sub { $urpm->{options}{metalink} = $_[1] }, - 'download-all!' => sub { $urpm->{options}{'download-all'} = $_[1] }, - + 'download-all:s' => sub { $urpm->{options}{'download-all'} = $_[1] }, # deprecated in favor of --downloader xxx wget => sub { $urpm->{options}{downloader} = 'wget' }, curl => sub { $urpm->{options}{downloader} = 'curl' }, diff --git a/urpm/main_loop.pm b/urpm/main_loop.pm index fdcff529..6c39759c 100644 --- a/urpm/main_loop.pm +++ b/urpm/main_loop.pm @@ -94,10 +94,15 @@ sub download_packages { join("\n", map { " $_->[0]" } @bad)); } } + (\@error_sources, \@msgs); } -if ($urpm->{options}{'download-all'}) { +if (exists $urpm->{options}{'download-all'}) { + if ($urpm->{options}{'download-all'}) { + $urpm->{cachedir} = $urpm->{'urpmi-root'}.$urpm->{options}{'download-all'}; + urpm::init_cache_dir($urpm, $urpm->{cachedir}); + } my (undef, $available) = urpm::sys::df("$urpm->{cachedir}/rpms"); if (!$urpm->{options}{ignoresize}) { -- cgit v1.2.1