diff options
author | Francois Pons <fpons@mandriva.com> | 2001-10-08 16:59:21 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-10-08 16:59:21 +0000 |
commit | 4fe91335bb07dcff1ecf8174cfd0170dfd632739 (patch) | |
tree | fe272f764bd3a5c5957fe6cf0ba4defcd9f6169b /urpm.pm | |
parent | 046f4775d1a5a719cdea1e4d3cbc5a0bd081bcc4 (diff) | |
download | urpmi-4fe91335bb07dcff1ecf8174cfd0170dfd632739.tar urpmi-4fe91335bb07dcff1ecf8174cfd0170dfd632739.tar.gz urpmi-4fe91335bb07dcff1ecf8174cfd0170dfd632739.tar.bz2 urpmi-4fe91335bb07dcff1ecf8174cfd0170dfd632739.tar.xz urpmi-4fe91335bb07dcff1ecf8174cfd0170dfd632739.zip |
make sure to remove a stale rpm file in cache (if size is 0), seems to have been
avoid for final 8.1 ?
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 25 |
1 files changed, 15 insertions, 10 deletions
@@ -1518,17 +1518,22 @@ sub get_source_packages { #- examine the local repository, which is trusted. opendir D, "$urpm->{cachedir}/rpms"; while (defined($_ = readdir D)) { - if (/([^\/]*)\.rpm/ && -s "$urpm->{cachedir}/rpms/$1.rpm") { - if (keys(%{$file2fullnames{$1} || {}}) > 1) { - $urpm->{error}(_("there are multiples packages with the same rpm filename \"%s\""), $1); - next; - } elsif (keys(%{$file2fullnames{$1} || {}}) == 1) { - my ($fullname) = keys(%{$file2fullnames{$1} || {}}); - if (defined delete $fullname2id{$fullname}) { - push @local_sources, "$urpm->{cachedir}/rpms/$1.rpm"; - } else { - push @local_to_removes, "$urpm->{cachedir}/rpms/$1.rpm"; + if (/([^\/]*)\.rpm/) { + if (-s "$urpm->{cachedir}/rpms/$1.rpm") { + if (keys(%{$file2fullnames{$1} || {}}) > 1) { + $urpm->{error}(_("there are multiples packages with the same rpm filename \"%s\""), $1); + next; + } elsif (keys(%{$file2fullnames{$1} || {}}) == 1) { + my ($fullname) = keys(%{$file2fullnames{$1} || {}}); + if (defined delete $fullname2id{$fullname}) { + push @local_sources, "$urpm->{cachedir}/rpms/$1.rpm"; + } else { + push @local_to_removes, "$urpm->{cachedir}/rpms/$1.rpm"; + } } + } else { + #- this is an invalid file in cache, remove it and ignore it. + unlink "$urpm->{cachedir}/rpms/$1.rpm"; } } #- no error on unknown filename located in cache (because .listing) } |