Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@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 16:31:26
Message-Id: 5630F84B.3070602@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222) by Alexander Berntsen
1 On 10/28/2015 04:44 AM, Alexander Berntsen wrote:
2 > Sheesh. That expression barely fits in a tweet. ;) Please just use
3 > intermediate statements or an if or something. Otherwise LGTM.
4
5 I've split it with an if, and also eliminated a redundant comparison
6 since long(cache_mtime) == mydir_stat.st_mtime implies that
7 mydir_stat.st_mtime == mydir_stat[stat.ST_MTIME], so here's what I've
8 pushed:
9
10 if cache_mtime == mydir_stat.st_mtime:
11 cache_valid = True
12
13 # Handle truncated mtime in order to avoid cache
14 # invalidation for livecd squashfs (bug 564222).
15 elif long(cache_mtime) == mydir_stat.st_mtime:
16 cache_valid = True
17
18 --
19 Thanks,
20 Zac

Replies