diff options
author | Christophe Fergeau <cfergeau@mandriva.com> | 2010-05-11 13:16:52 +0000 |
---|---|---|
committer | Christophe Fergeau <cfergeau@mandriva.com> | 2010-05-11 13:16:52 +0000 |
commit | 050ab2fa9941305f415d5be7e53c7d33d339ad57 (patch) | |
tree | e6661c3ced6ec0c004b37dc1bcf1c86bc1d5c3df | |
parent | 950144227b9b3f41c05a9c56032e74f8e0e94daf (diff) | |
download | urpmi-050ab2fa9941305f415d5be7e53c7d33d339ad57.tar urpmi-050ab2fa9941305f415d5be7e53c7d33d339ad57.tar.gz urpmi-050ab2fa9941305f415d5be7e53c7d33d339ad57.tar.bz2 urpmi-050ab2fa9941305f415d5be7e53c7d33d339ad57.tar.xz urpmi-050ab2fa9941305f415d5be7e53c7d33d339ad57.zip |
reload mirror list cache if it's in an "old" format
old mirror list caches didn't store the time of the product.id file.
When such a file is encountered, make sure we invalidate the cache.
Otherwise, when upgrading from a distro where the mirror list cache
didn't have the product.id mtime to a distro where the mirror list cache
would have it, the mirror list cache won't be invalidated
-rw-r--r-- | urpm/mirrors.pm | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/urpm/mirrors.pm b/urpm/mirrors.pm index c9223fa7..7cee554f 100644 --- a/urpm/mirrors.pm +++ b/urpm/mirrors.pm @@ -155,6 +155,9 @@ sub _cache__may_clean_if_outdated { time() > $cache->{time} + 24*60*60 * $urpm->{options}{'days-between-mirrorlist-update'}) { $urpm->{log}("not using outdated cached mirror list $mirrorlist"); _trigger_cache_update ($urpm, $cache); + } elsif (!$cache->{product_id_mtime}) { + $urpm->{log}("cached mirror list uses an old format, invalidating it"); + _trigger_cache_update ($urpm, $cache, 1); } elsif ($cache->{product_id_mtime} && _product_id_mtime() != $cache->{product_id_mtime}) { $urpm->{log}("not using cached mirror list $mirrorlist since product id file changed"); _trigger_cache_update ($urpm, $cache, 1); |