summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-18 16:33:02 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-18 16:33:02 +0000
commit0b2945a6325ba5f5ce82f07593eaaa1934854879 (patch)
tree377378ccd282ce7db7540bf2764b0ab9a6071b06 /urpm
parent389048ecdd1ab3434a445d56e4c13f7221739c8b (diff)
downloadurpmi-0b2945a6325ba5f5ce82f07593eaaa1934854879.tar
urpmi-0b2945a6325ba5f5ce82f07593eaaa1934854879.tar.gz
urpmi-0b2945a6325ba5f5ce82f07593eaaa1934854879.tar.bz2
urpmi-0b2945a6325ba5f5ce82f07593eaaa1934854879.tar.xz
urpmi-0b2945a6325ba5f5ce82f07593eaaa1934854879.zip
- urpmi:
o --install-src as user now works for remote medium
Diffstat (limited to 'urpm')
-rw-r--r--urpm/get_pkgs.pm14
1 files changed, 11 insertions, 3 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index 0906ee54..cc8d41af 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -138,15 +138,23 @@ sub download_packages_of_distant_media {
my $partial_dir = "$urpm->{cachedir}/partial";
my $rpms_dir = "$urpm->{cachedir}/rpms";
if (%distant_sources && ! -w $partial_dir) {
- $urpm->{error}(N("sorry, you can't use --install-src to install remote .src.rpm files"));
- exit 1;
+ if (my $userdir = urpm::userdir($urpm)) {
+ $partial_dir = "$userdir/partial";
+ $rpms_dir = "$userdir/rpms";
+ mkdir $download_dir;
+ mkdir $rpms_dir;
+ } else {
+ $urpm->{error}(N("sorry, you can't use --install-src to install remote .src.rpm files"));
+ exit 1;
+ }
}
#- download files from the current medium.
if (%distant_sources) {
$urpm->{log}(N("retrieving rpm files from medium \"%s\"...", $urpm->{media}[$n]{name}));
if (urpm::download::sync($urpm, $urpm->{media}[$n], [ values %distant_sources ],
- quiet => $options{quiet}, resume => $urpm->{options}{resume}, callback => $options{callback})) {
+ dir => $partial_dir, quiet => $options{quiet},
+ resume => $urpm->{options}{resume}, callback => $options{callback})) {
$urpm->{log}(N("...retrieving done"));
} else {
$urpm->{error}(N("...retrieving failed: %s", $@));