summaryrefslogtreecommitdiffstats
path: root/urpm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm')
-rw-r--r--urpm/get_pkgs.pm4
-rw-r--r--urpm/sys.pm5
2 files changed, 7 insertions, 2 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm
index 91afa3f8..00083205 100644
--- a/urpm/get_pkgs.pm
+++ b/urpm/get_pkgs.pm
@@ -13,8 +13,8 @@ sub clean_all_cache {
my ($urpm) = @_;
#- clean download directory, do it here even if this is not the best moment.
$urpm->{log}(N("cleaning %s and %s", "$urpm->{cachedir}/partial", "$urpm->{cachedir}/rpms"));
- urpm::sys::clean_dir("$urpm->{cachedir}/partial");
- urpm::sys::clean_dir("$urpm->{cachedir}/rpms");
+ urpm::sys::empty_dir("$urpm->{cachedir}/partial");
+ urpm::sys::empty_dir("$urpm->{cachedir}/rpms");
}
#- select sources for selected packages,
diff --git a/urpm/sys.pm b/urpm/sys.pm
index acbc5a9e..cf32d42c 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -257,6 +257,11 @@ sub clean_dir {
require File::Path;
File::Path::rmtree([$dir]);
+}
+
+sub empty_dir {
+ my ($dir) = @_;
+ clean_dir($dir);
mkdir $dir, 0755;
}