summaryrefslogtreecommitdiffstats
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
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!
-rw-r--r--urpm.pm29
-rw-r--r--urpmi.spec2
2 files changed, 19 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)
diff --git a/urpmi.spec b/urpmi.spec
index 6d331e77..99385ed2 100644
--- a/urpmi.spec
+++ b/urpmi.spec
@@ -199,6 +199,8 @@ $urpm->update_media;
%changelog
+- fixed bad file in cache not cleaned.
+
* Thu Apr 24 2003 François Pons <fpons@mandrakesoft.com> 4.3-7mdk
- added -v to urpme and removed default log.
- avoid curl output to be seen.