summaryrefslogtreecommitdiffstats
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
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
-rw-r--r--NEWS2
-rw-r--r--urpm/get_pkgs.pm14
2 files changed, 13 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index cedf5c63..4f5033e4 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@
o deprecate --curl and --wget in favor of --downloader curl
and --downloader --wget
o fix displaying error message when failing to lock (regression in 5.1)
+- urpmi:
+ o --install-src as user now works for remote medium
- urpmf:
o add special code for --files simple case, it makes urpmf 3x faster for
this often used case
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", $@));