diff options
author | Francois Pons <fpons@mandriva.com> | 2001-04-10 15:12:38 +0000 |
---|---|---|
committer | Francois Pons <fpons@mandriva.com> | 2001-04-10 15:12:38 +0000 |
commit | 0a48000576777a80a8aca497746b395d8c453a06 (patch) | |
tree | 9b018975c423eadcf2b866902f9eb053f26cfa2a /urpm.pm | |
parent | 4a5a9aa1ab7a6d12c20dec95a95e596d900d356f (diff) | |
download | urpmi-0a48000576777a80a8aca497746b395d8c453a06.tar urpmi-0a48000576777a80a8aca497746b395d8c453a06.tar.gz urpmi-0a48000576777a80a8aca497746b395d8c453a06.tar.bz2 urpmi-0a48000576777a80a8aca497746b395d8c453a06.tar.xz urpmi-0a48000576777a80a8aca497746b395d8c453a06.zip |
*** empty log message ***
Diffstat (limited to 'urpm.pm')
-rw-r--r-- | urpm.pm | 21 |
1 files changed, 21 insertions, 0 deletions
@@ -629,6 +629,27 @@ sub update_media { $urpm->write_base_files(); $urpm->{modified} = 0; } + + #- clean headers cache directory to remove everything that is no more + #- usefull according to depslist used. + if ($options{noclean}) { + local (*D, $_); + my %arch; + opendir D, "$urpm->{cachedir}/headers"; + while (defined($_ = readdir D)) { + /^([^\/]*)-([^-]*)-([^-]*)\.([^\.]*)$/ and $arch{"$1-$2-$3"} = $4; + } + closedir D; + $urpm->{log}("found " . scalar(keys %arch) . " headers in cache"); + foreach (@{$urpm->{params}{depslist}}) { + delete $arch{"$_->{name}-$_->{version}-$_->{release}"}; + } + $urpm->{log}("removing " . scalar(keys %arch) . " obsolete headers in cache"); + foreach (keys %arch) { + unlink "$urpm->{cachedir}/headers/$_.$arch{$_}"; + } + } + #- this file is written in any cases. $urpm->write_config(); |