diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-26 20:58:13 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-26 20:58:13 +0000 |
commit | 17aae3de9b3c922ec422db55747d34fe88c15f2f (patch) | |
tree | a485fc0fb8e87d4509a42b27888ece660693ec95 /urpm | |
parent | cb1d5b4418f3fb72933d0b1f6529c3877a890789 (diff) | |
download | urpmi-17aae3de9b3c922ec422db55747d34fe88c15f2f.tar urpmi-17aae3de9b3c922ec422db55747d34fe88c15f2f.tar.gz urpmi-17aae3de9b3c922ec422db55747d34fe88c15f2f.tar.bz2 urpmi-17aae3de9b3c922ec422db55747d34fe88c15f2f.tar.xz urpmi-17aae3de9b3c922ec422db55747d34fe88c15f2f.zip |
move removing bad file inside verify_partial_rpm_and_move()
(it won't hurt urpm::removable::_do_the_copy())
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/get_pkgs.pm | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/urpm/get_pkgs.pm b/urpm/get_pkgs.pm index 0068b95b..91afa3f8 100644 --- a/urpm/get_pkgs.pm +++ b/urpm/get_pkgs.pm @@ -108,8 +108,10 @@ sub selected2list { sub verify_partial_rpm_and_move { my ($urpm, $cachedir, $filename) = @_; - URPM::verify_rpm("$cachedir/partial/$filename", nosignatures => 1) or return; - + URPM::verify_rpm("$cachedir/partial/$filename", nosignatures => 1) or do { + unlink "$cachedir/partial/$filename"; + return; + }; #- it seems the the file has been downloaded correctly and has been checked to be valid. unlink "$cachedir/rpms/$filename"; urpm::sys::move_or_die($urpm, "$cachedir/partial/$filename", "$cachedir/rpms/$filename"); @@ -180,7 +182,6 @@ sub download_packages_of_distant_media { if (my $rpm = verify_partial_rpm_and_move($urpm, $cachedir, $filename)) { $sources->{$i} = $rpm; } else { - unlink "$cachedir/partial/$filename"; $errors{$i} = [ $distant_sources{$i}, 'bad' ]; } } else { |