diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-06-24 13:21:20 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-06-24 13:21:20 +0000 |
commit | 5d740abac49f175662254526c91acf2e130c8a6b (patch) | |
tree | ff2c17e0d0b809dda9b740e5b4652d53a8000048 /urpm | |
parent | 9e44fa13392197983dc413aba1097d8da287a006 (diff) | |
download | urpmi-5d740abac49f175662254526c91acf2e130c8a6b.tar urpmi-5d740abac49f175662254526c91acf2e130c8a6b.tar.gz urpmi-5d740abac49f175662254526c91acf2e130c8a6b.tar.bz2 urpmi-5d740abac49f175662254526c91acf2e130c8a6b.tar.xz urpmi-5d740abac49f175662254526c91acf2e130c8a6b.zip |
empty_dir() is a better name, clean_dir() will be used for just removing the dir
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/get_pkgs.pm | 4 | ||||
-rw-r--r-- | urpm/sys.pm | 5 |
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; } |