summaryrefslogtreecommitdiffstats
path: root/urpm/media.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-09-04 14:17:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-09-04 14:17:16 +0000
commit55208824334294d60c0cda65e0f245f8831a6ace (patch)
tree6298d63e9d6b328f745ba59348030d40fd8f2b1a /urpm/media.pm
parent542aa55f7bee301752370c9a51e9af2490c6a781 (diff)
downloadurpmi-55208824334294d60c0cda65e0f245f8831a6ace.tar
urpmi-55208824334294d60c0cda65e0f245f8831a6ace.tar.gz
urpmi-55208824334294d60c0cda65e0f245f8831a6ace.tar.bz2
urpmi-55208824334294d60c0cda65e0f245f8831a6ace.tar.xz
urpmi-55208824334294d60c0cda65e0f245f8831a6ace.zip
much nicer userdir() functions:
- userdir() does not modify $urpm->{cachedir} anymore, if you must ensure $urpm->{cachedir} to be modified, use ensure_valid_cachedir() - valid_cachedir() gives you a valid cachedir (works for root or simple-user), but does not modify $urpm->{cachedir}
Diffstat (limited to 'urpm/media.pm')
-rw-r--r--urpm/media.pm8
1 files changed, 3 insertions, 5 deletions
diff --git a/urpm/media.pm b/urpm/media.pm
index 94fb7f69..fae5abb2 100644
--- a/urpm/media.pm
+++ b/urpm/media.pm
@@ -1763,12 +1763,10 @@ sub _any_media_info__or_download {
-s $f and return $f;
my $download_dir;
- if (my $userdir = urpm::userdir($urpm)) {
- $f = "$userdir/" . statedir_media_info_basename($medium, $prefix, $suffix);
+ if ($<) {
+ urpm::ensure_valid_cachedir($urpm);
+ $f = "$urpm->{cachedir}/" . statedir_media_info_basename($medium, $prefix, $suffix);
-s $f and return $f;
-
- $download_dir = "$userdir/partial";
- mkdir $download_dir;
}
get_medium_option($urpm, $medium, 'xml-info') ne 'never' or return;