diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 10:06:55 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2006-11-13 10:06:55 +0000 |
commit | c6fdae076c296fc717c33b6bb2fb84d586bbf125 (patch) | |
tree | 19ef48f25d23cc3334cd0b1073d48b90076a1e87 /urpm.pm | |
parent | 7bc61a82411b425ac3e7fee85cf236583099e687 (diff) | |
download | urpmi-c6fdae076c296fc717c33b6bb2fb84d586bbf125.tar urpmi-c6fdae076c296fc717c33b6bb2fb84d586bbf125.tar.gz urpmi-c6fdae076c296fc717c33b6bb2fb84d586bbf125.tar.bz2 urpmi-c6fdae076c296fc717c33b6bb2fb84d586bbf125.tar.xz urpmi-c6fdae076c296fc717c33b6bb2fb84d586bbf125.zip |
don't clean obsolete headers in cache if cache is empty
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -1904,13 +1904,15 @@ sub remove_obsolete_headers_in_cache { } closedir $dh; } - $urpm->{log}(N("found %d headers in cache", scalar(keys %headers))); - foreach (@{$urpm->{depslist}}) { - delete $headers{$_->fullname}; - } - $urpm->{log}(N("removing %d obsolete headers in cache", scalar(keys %headers))); - foreach (values %headers) { - unlink "$urpm->{cachedir}/headers/$_"; + if (%headers) { + $urpm->{log}(N("found %d headers in cache", scalar(keys %headers))); + foreach (@{$urpm->{depslist}}) { + delete $headers{$_->fullname}; + } + $urpm->{log}(N("removing %d obsolete headers in cache", scalar(keys %headers))); + foreach (values %headers) { + unlink "$urpm->{cachedir}/headers/$_"; + } } } |