summaryrefslogtreecommitdiffstats
path: root/urpm/mirrors.pm
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@mandriva.com>2009-12-08 11:01:35 +0000
committerChristophe Fergeau <cfergeau@mandriva.com>2009-12-08 11:01:35 +0000
commitd09e513b522345086ded06b62fde92600bbc26e3 (patch)
tree182ac76e3e8c805dfd1761d34f6ab34c823fa463 /urpm/mirrors.pm
parente8b2146b768dca0922295accb91ff37fbd2faf5a (diff)
downloadurpmi-d09e513b522345086ded06b62fde92600bbc26e3.tar
urpmi-d09e513b522345086ded06b62fde92600bbc26e3.tar.gz
urpmi-d09e513b522345086ded06b62fde92600bbc26e3.tar.bz2
urpmi-d09e513b522345086ded06b62fde92600bbc26e3.tar.xz
urpmi-d09e513b522345086ded06b62fde92600bbc26e3.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
Diffstat (limited to 'urpm/mirrors.pm')
-rw-r--r--urpm/mirrors.pm3
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);