diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 09:32:16 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 09:32:16 +0000 |
commit | 3ec10907cdac80d0d8ddacd7596cf9df40b0af40 (patch) | |
tree | 5875814283f06b64bfd38f5759b0c8bd0df25d7e | |
parent | 97b973570b8a60ed88bbc1aeb6bbb3d78a561e7d (diff) | |
download | urpmi-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.pm | 15 |
1 files changed, 10 insertions, 5 deletions
@@ -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); |