From mboxrd@z Thu Jan  1 00:00:00 1970
Return-Path: <gentoo-portage-dev+bounces-5184-garchives=archives.gentoo.org@lists.gentoo.org>
Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80])
	by finch.gentoo.org (Postfix) with ESMTP id D412913888F
	for <garchives@archives.gentoo.org>; Wed, 28 Oct 2015 16:31:26 +0000 (UTC)
Received: from pigeon.gentoo.org (localhost [127.0.0.1])
	by pigeon.gentoo.org (Postfix) with SMTP id 6BA4221C002;
	Wed, 28 Oct 2015 16:31:20 +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 E139F21C001
	for <gentoo-portage-dev@lists.gentoo.org>; Wed, 28 Oct 2015 16:31:14 +0000 (UTC)
Received: from [192.168.0.13] (ip174-67-193-3.oc.oc.cox.net [174.67.193.3])
	(using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
	(No client certificate requested)
	(Authenticated sender: zmedico)
	by smtp.gentoo.org (Postfix) with ESMTPSA id A24943409D7
	for <gentoo-portage-dev@lists.gentoo.org>; Wed, 28 Oct 2015 16:31:11 +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>
 <5630B507.4010800@gentoo.org>
From: Zac Medico <zmedico@gentoo.org>
Message-ID: <5630F84B.3070602@gentoo.org>
Date: Wed, 28 Oct 2015 09:31:07 -0700
User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101
 Thunderbird/38.3.0
Precedence: bulk
List-Post: <mailto:gentoo-portage-dev@lists.gentoo.org>
List-Help: <mailto:gentoo-portage-dev+help@lists.gentoo.org>
List-Unsubscribe: <mailto:gentoo-portage-dev+unsubscribe@lists.gentoo.org>
List-Subscribe: <mailto:gentoo-portage-dev+subscribe@lists.gentoo.org>
List-Id: Gentoo Linux mail <gentoo-portage-dev.gentoo.org>
X-BeenThere: gentoo-portage-dev@lists.gentoo.org
Reply-to: gentoo-portage-dev@lists.gentoo.org
MIME-Version: 1.0
In-Reply-To: <5630B507.4010800@gentoo.org>
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 7bit
X-Archives-Salt: e3784dc3-2a42-44d0-adcf-a2447252fae3
X-Archives-Hash: 24c4dca8c0afb2329925e5805b32a8ae

On 10/28/2015 04:44 AM, Alexander Berntsen wrote:
> Sheesh. That expression barely fits in a tweet. ;) Please just use
> intermediate statements or an if or something. Otherwise LGTM.

I've split it with an if, and also eliminated a redundant comparison
since long(cache_mtime) == mydir_stat.st_mtime implies that
mydir_stat.st_mtime == mydir_stat[stat.ST_MTIME], so here's what I've
pushed:

	if cache_mtime == mydir_stat.st_mtime:
		cache_valid = True

	# Handle truncated mtime in order to avoid cache
	# invalidation for livecd squashfs (bug 564222).
	elif long(cache_mtime) == mydir_stat.st_mtime:
		cache_valid = True

-- 
Thanks,
Zac