public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
Search results ordered by [date|relevance]  view[summary|nested|Atom feed]
thread overview below | download: 
* [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222)
@ 2015-10-28  1:52 99% Zac Medico
  0 siblings, 0 replies; 1+ results
From: Zac Medico @ 2015-10-28  1:52 UTC (permalink / raw
  To: gentoo-portage-dev; +Cc: Zac Medico

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 5ba8d9d..bac9837 100644
--- a/pym/portage/dbapi/vartree.py
+++ b/pym/portage/dbapi/vartree.py
@@ -728,7 +728,11 @@ class vardbapi(dbapi):
 		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]
-- 
2.4.9



^ permalink raw reply related	[relevance 99%]

Results 1-1 of 1 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2015-10-28  1:52 99% [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222) Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox