summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--urpm.pm3
-rw-r--r--urpm/get_pkgs.pm9
2 files changed, 5 insertions, 7 deletions
diff --git a/urpm.pm b/urpm.pm
index 5eacb51a..f0ac28f6 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -113,6 +113,9 @@ sub userdir {
$urpm->{cachedir} = $dir;
+ mkdir "$dir/partial";
+ mkdir "$dir/rpms";
+
$dir;
}
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index 82bccb01..b0545107 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -210,13 +210,8 @@ sub _download_packages_of_distant_media {
my $cachedir = $urpm->{cachedir};
if (! -w "$cachedir/partial") {
- if (my $userdir = urpm::userdir($urpm)) {
- $cachedir = $userdir;
- mkdir "$cachedir/partial";
- mkdir "$cachedir/rpms";
- } else {
- $urpm->{fatal}(1, N("Can not download packages into %s", "$cachedir/partial"));
- }
+ $cachedir = urpm::userdir($urpm)
+ or $urpm->{fatal}(1, N("Can not download packages into %s", "$cachedir/partial"));
}
$urpm->{log}(N("retrieving rpm files from medium \"%s\"...", $blist->{medium}{name}));