Gentoo Archives: gentoo-portage-dev

From: "Rick \\\"Zero_Chaos\\\" Farina" <zerochaos@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222)
Date: Wed, 28 Oct 2015 03:27:50
Message-Id: 563040C6.1020609@gentoo.org
In Reply to: [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222) by Zac Medico
1 This speeds up initial emerge run on my livecd by eight minutes. Please
2 accept.
3
4 Thanks,
5 Zero
6
7 On 10/27/2015 09:52 PM, Zac Medico wrote:
8 > X-Gentoo-Bug: 564222
9 > X-Gentoo-Bug-URL: https://bugs.gentoo.org/show_bug.cgi?id=564222
10 > ---
11 > pym/portage/dbapi/vartree.py | 6 +++++-
12 > 1 file changed, 5 insertions(+), 1 deletion(-)
13 >
14 > diff --git a/pym/portage/dbapi/vartree.py b/pym/portage/dbapi/vartree.py
15 > index 5ba8d9d..bac9837 100644
16 > --- a/pym/portage/dbapi/vartree.py
17 > +++ b/pym/portage/dbapi/vartree.py
18 > @@ -728,7 +728,11 @@ class vardbapi(dbapi):
19 > if pkg_data:
20 > cache_mtime, metadata = pkg_data
21 > if isinstance(cache_mtime, float):
22 > - cache_valid = cache_mtime == mydir_stat.st_mtime
23 > + # Handle truncated mtime in order to avoid cache
24 > + # invalidation for livecd squashfs (bug 564222).
25 > + cache_valid = cache_mtime == mydir_stat.st_mtime or (
26 > + mydir_stat.st_mtime == mydir_stat[stat.ST_MTIME]
27 > + and long(cache_mtime) == mydir_stat[stat.ST_MTIME])
28 > else:
29 > # Cache may contain integer mtime.
30 > cache_valid = cache_mtime == mydir_stat[stat.ST_MTIME]
31 >