From ca8505cf52354c0ac3b1feb1900dc034658072b0 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Mon, 26 Oct 2015 16:29:46 -0700 Subject: [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222) X-Gentoo-Bug: 564222 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=564222 --- pym/portage/dbapi/vartree.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py index 5ba8d9d343..bac983798f 100644 --- a/pym/portage/dbapi/vartree.py +++ b/pym/portage/dbapi/vartree.py @@ -728,7 +728,11 @@ def aux_get(self, mycpv, wants, myrepo = None): if pkg_data: cache_mtime, metadata = pkg_data if isinstance(cache_mtime, float): - cache_valid = cache_mtime == mydir_stat.st_mtime + # Handle truncated mtime in order to avoid cache + # invalidation for livecd squashfs (bug 564222). + cache_valid = cache_mtime == mydir_stat.st_mtime or ( + mydir_stat.st_mtime == mydir_stat[stat.ST_MTIME] + and long(cache_mtime) == mydir_stat[stat.ST_MTIME]) else: # Cache may contain integer mtime. cache_valid = cache_mtime == mydir_stat[stat.ST_MTIME]