summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm16
1 files changed, 9 insertions, 7 deletions
diff --git a/urpm.pm b/urpm.pm
index e9e6e39e..c9470df5 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -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/$_";
+ }
}
}