diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-02-24 10:06:23 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-02-24 10:06:23 +0000 |
commit | 5e1c20f181fac8df0636ecd04b24832ddb6cbc27 (patch) | |
tree | bf01f0d9c108340282026fb02bb1addb736c2d84 /urpm | |
parent | 511e443ea064f0c2cb3cc6788d8ed25b59ef2895 (diff) | |
download | urpmi-5e1c20f181fac8df0636ecd04b24832ddb6cbc27.tar urpmi-5e1c20f181fac8df0636ecd04b24832ddb6cbc27.tar.gz urpmi-5e1c20f181fac8df0636ecd04b24832ddb6cbc27.tar.bz2 urpmi-5e1c20f181fac8df0636ecd04b24832ddb6cbc27.tar.xz urpmi-5e1c20f181fac8df0636ecd04b24832ddb6cbc27.zip |
make it fatal to fail to remove cachedir rpms
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/install.pm | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/urpm/install.pm b/urpm/install.pm index ec069548..3c0e91f3 100644 --- a/urpm/install.pm +++ b/urpm/install.pm @@ -194,7 +194,7 @@ sub install { my $cachefile = "$urpm->{cachedir}/rpms/" . $pkg->filename; if (-e $cachefile) { $urpm->{error}(N("removing bad rpm (%s) from %s", $pkg->name, "$urpm->{cachedir}/rpms")); - unlink $cachefile; + unlink $cachefile or $urpm->{fatal}(1, N("removing %s failed: %s", $cachefile, $!)); } } } @@ -250,7 +250,9 @@ sub install { my $cachedir = "$urpm->{cachedir}/rpms"; my @pkgs = grep { -e "$cachedir/$_" } map { $_->filename } @trans_pkgs; $urpm->{log}(N("removing installed rpms (%s) from %s", join(' ', @pkgs), $cachedir)); - unlink "$cachedir/$_" foreach @pkgs; + foreach (@pkgs) { + unlink "$cachedir/$_ " or $urpm->{fatal}(1, N("removing %s failed: %s", $_, $!)); + } } if ($options{verbose} >= 0) { |