summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-13 09:32:16 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-13 09:32:16 +0000
commit3ec10907cdac80d0d8ddacd7596cf9df40b0af40 (patch)
tree5875814283f06b64bfd38f5759b0c8bd0df25d7e
parent97b973570b8a60ed88bbc1aeb6bbb3d78a561e7d (diff)
downloadurpmi-3ec10907cdac80d0d8ddacd7596cf9df40b0af40.tar
urpmi-3ec10907cdac80d0d8ddacd7596cf9df40b0af40.tar.gz
urpmi-3ec10907cdac80d0d8ddacd7596cf9df40b0af40.tar.bz2
urpmi-3ec10907cdac80d0d8ddacd7596cf9df40b0af40.tar.xz
urpmi-3ec10907cdac80d0d8ddacd7596cf9df40b0af40.zip
create clean_dir() out of get_source_packages
-rw-r--r--urpm.pm15
1 files changed, 10 insertions, 5 deletions
diff --git a/urpm.pm b/urpm.pm
index a3fa2b8b..392207f2 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -1202,6 +1202,15 @@ sub recursive_find_rpm_files {
keys %f;
}
+sub clean_dir {
+ my ($dir) = @_;
+
+ require File::Path;
+ File::Path::rmtree([$dir]);
+ mkdir $dir, 0755;
+}
+
+
#- Update the urpmi database w.r.t. the current configuration.
#- Takes care of modifications, and tries some tricks to bypass
#- the recomputation of base files.
@@ -2404,11 +2413,7 @@ sub get_source_packages {
}
#- clean download directory, do it here even if this is not the best moment.
- if ($options{clean_all}) {
- require File::Path;
- File::Path::rmtree(["$urpm->{cachedir}/partial"]);
- mkdir "$urpm->{cachedir}/partial", 0755;
- }
+ clean_dir("$urpm->{cachedir}/partial") if $options{clean_all};
foreach my $medium (@{$urpm->{media} || []}) {
my (%sources, %list_examined, $list_warning);