public inbox for gentoo-portage-dev@lists.gentoo.org
 help / color / mirror / Atom feed
From: Zac Medico <zmedico@gentoo.org>
To: gentoo-portage-dev@lists.gentoo.org
Cc: Zac Medico <zmedico@gentoo.org>
Subject: [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222)
Date: Tue, 27 Oct 2015 18:52:03 -0700	[thread overview]
Message-ID: <1445997123-5192-1-git-send-email-zmedico@gentoo.org> (raw)

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



             reply	other threads:[~2015-10-28  1:52 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-10-28  1:52 Zac Medico [this message]
2015-10-28  3:28 ` [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222) Rick "Zero_Chaos" Farina
2015-10-28 11:44 ` Alexander Berntsen
2015-10-28 16:31   ` Zac Medico
2015-10-29  9:30     ` Alexander Berntsen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1445997123-5192-1-git-send-email-zmedico@gentoo.org \
    --to=zmedico@gentoo.org \
    --cc=gentoo-portage-dev@lists.gentoo.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox