From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) by finch.gentoo.org (Postfix) with ESMTP id 530CC13888F for ; Wed, 28 Oct 2015 03:27:50 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id BCEFFE0839; Wed, 28 Oct 2015 03:27:47 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id 35D72E0825 for ; Wed, 28 Oct 2015 03:27:47 +0000 (UTC) Received: from [192.168.1.250] (pool-72-95-142-247.pitbpa.fios.verizon.net [72.95.142.247]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: zerochaos) by smtp.gentoo.org (Postfix) with ESMTPSA id 4015D3409D7 for ; Wed, 28 Oct 2015 03:27:45 +0000 (UTC) Subject: Re: [gentoo-portage-dev] [PATCH] vardbapi.aux_get: treat cache as valid if mtime is truncated (bug 564222) To: gentoo-portage-dev@lists.gentoo.org References: <1445997123-5192-1-git-send-email-zmedico@gentoo.org> From: "Rick \"Zero_Chaos\" Farina" Message-ID: <563040C6.1020609@gentoo.org> Date: Tue, 27 Oct 2015 23:28:06 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-portage-dev@lists.gentoo.org Reply-to: gentoo-portage-dev@lists.gentoo.org MIME-Version: 1.0 In-Reply-To: <1445997123-5192-1-git-send-email-zmedico@gentoo.org> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit X-Archives-Salt: 99123a38-7bf3-420a-ab0a-4c9f273be431 X-Archives-Hash: 0bb2fce1fc52fc051b9ecd02bd132462 This speeds up initial emerge run on my livecd by eight minutes. Please accept. Thanks, Zero On 10/27/2015 09:52 PM, Zac Medico wrote: > 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] >