Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Cc: Zac Medico <zmedico@g.o>
Subject: [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222)
Date: Wed, 28 Oct 2015 01:52:37
Message-Id: 1445997123-5192-1-git-send-email-zmedico@gentoo.org
1 X-Gentoo-Bug: 564222
2 X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=564222
3 ---
4 pym/portage/dbapi/vartree.py | 6 +++++-
5 1 file changed, 5 insertions(+), 1 deletion(-)
6
7 diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
8 index 5ba8d9d..bac9837 100644
9 --- a/pym/portage/dbapi/vartree.py
10 +++ b/pym/portage/dbapi/vartree.py
11 @@ -728,7 +728,11 @@ class vardbapi(dbapi):
12 if pkg_data:
13 cache_mtime, metadata = pkg_data
14 if isinstance(cache_mtime, float):
15 - cache_valid = cache_mtime == mydir_stat.st_mtime
16 + # Handle truncated mtime in order to avoid cache
17 + # invalidation for livecd squashfs (bug 564222).
18 + cache_valid = cache_mtime == mydir_stat.st_mtime or (
19 + mydir_stat.st_mtime == mydir_stat[stat.ST_MTIME]
20 + and long(cache_mtime) == mydir_stat[stat.ST_MTIME])
21 else:
22 # Cache may contain integer mtime.
23 cache_valid = cache_mtime == mydir_stat[stat.ST_MTIME]
24 --
25 2.4.9

Replies