From d09e513b522345086ded06b62fde92600bbc26e3 Mon Sep 17 00:00:00 2001 From: Christophe Fergeau Date: Tue, 8 Dec 2009 11:01:35 +0000 Subject: 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 --- urpm/mirrors.pm | 3 +++ 1 file changed, 3 insertions(+) (limited to 'urpm') 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); -- cgit v1.2.1