summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorFrancois Pons <fpons@mandriva.com>2003-04-24 21:26:59 +0000
committerFrancois Pons <fpons@mandriva.com>2003-04-24 21:26:59 +0000
commit2837931024ccbfe17ded29c7c0a3e8fb53e9f988 (patch)
tree58171f2146d1168f4e804c2369f8b2a797291f82 /urpm.pm
parentf15b9910503bc8223f6b4eda600f9a4822cd2126 (diff)
downloadurpmi-2837931024ccbfe17ded29c7c0a3e8fb53e9f988.tar
urpmi-2837931024ccbfe17ded29c7c0a3e8fb53e9f988.tar.gz
urpmi-2837931024ccbfe17ded29c7c0a3e8fb53e9f988.tar.bz2
urpmi-2837931024ccbfe17ded29c7c0a3e8fb53e9f988.tar.xz
urpmi-2837931024ccbfe17ded29c7c0a3e8fb53e9f988.zip
fixed keep of bad package in cache!
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm29
1 files changed, 17 insertions, 12 deletions
diff --git a/urpm.pm b/urpm.pm
index 5fc26a97..08ffce0c 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -2210,25 +2210,30 @@ sub get_source_packages {
if (my ($filename) = /^([^\/]*\.rpm)$/) {
my $filepath = "$urpm->{cachedir}/rpms/$filename";
if (!$options{clean_all} && -s $filepath) {
- if (exists $usefull_files{$filename} && URPM::verify_rpm($filepath, nogpg => 1, nopgp => 1) =~ /md5 OK/) {
- if (keys(%{$file2fullnames{$filename} || {}}) > 1) {
- $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\""), $filename);
- next;
- } elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
- my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
- if (defined($id = delete $fullname2id{$fullname})) {
- $local_sources{$id} = $filepath;
+ if (exists $usefull_files{$filename}) {
+ if (URPM::verify_rpm($filepath, nogpg => 1, nopgp => 1) =~ /md5 OK/) {
+ if (keys(%{$file2fullnames{$filename} || {}}) > 1) {
+ $urpm->{error}(N("there are multiple packages with the same rpm filename \"%s\""), $filename);
+ next;
+ } elsif (keys(%{$file2fullnames{$filename} || {}}) == 1) {
+ my ($fullname) = keys(%{$file2fullnames{$filename} || {}});
+ if (defined($id = delete $fullname2id{$fullname})) {
+ $local_sources{$id} = $filepath;
+ } else {
+ $options{clean_other} and unlink $filepath;
+ }
} else {
$options{clean_other} and unlink $filepath;
}
} else {
- $options{clean_other} and unlink $filepath;
+ #- this is an invalid file in cache, remove it and ignore it.
+ #- or clean options has been given meaning ignore any file in cache
+ #- remove it too.
+ unlink $filepath;
}
} #- do not examine rpm file in cache that will not be used.
} else {
- #- this is an invalid file in cache, remove it and ignore it.
- #- or clean options has been given meaning ignore any file in cache
- #- remove it too.
+ #- this file should be removed or is already empty.
unlink $filepath;
}
} #- no error on unknown filename located in cache (because .listing)