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 7B160138CCE for ; Thu, 7 May 2015 18:43:32 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9EC55E0867; Thu, 7 May 2015 18:43:29 +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 19407E0866 for ; Thu, 7 May 2015 18:43:29 +0000 (UTC) Received: from [10.0.31.145] (unknown [100.42.98.7]) (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 00C3E340E82 for ; Thu, 7 May 2015 18:43:27 +0000 (UTC) Message-ID: <554BB24D.4050903@gentoo.org> Date: Thu, 07 May 2015 11:43:25 -0700 From: Zac Medico User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.5.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 To: gentoo-portage-dev@lists.gentoo.org Subject: Re: [gentoo-portage-dev] [PATCH] VdbMetadataDelta.applyDelta: remove replaced versions (bug 547532) References: <1429893170-7323-1-git-send-email-zmedico@gentoo.org> <554B1D17.60209@gentoo.org> In-Reply-To: <554B1D17.60209@gentoo.org> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Archives-Salt: e58a8158-ec3e-4fb4-bc10-acb938977da5 X-Archives-Hash: 004906139008e59a9812eaeb6c08b2cd On 05/07/2015 01:06 AM, Alexander Berntsen wrote: > On 24/04/15 18:32, Zac Medico wrote: >> - installed_package = installed_package[-1] >> + try: >> + self._vardb.match_unordered >> + except AttributeError: >> + installed_package = installed_package[-1] >> + else: >> + installed_package = portage.best(installed_package) >> + > This probably makes sense, but I don't understand how this helps to > alleviate the problem. Would you mind explaining it? This hunk just fixes to ensure that it shows the highest version in the case were there are multiple slot installed. Otherwise, since IndexedVardb returns unordered match results, it could randomly select a lower version from another slot. > The rest of the patch looks OK, even if I dislike the strong imperative > nature of the replaced versions removal. I'm open to suggestions if you can think of a nicer way to express it. It certainly be nicer if the data from vdb_metadata.pickle had the packages indexed by ${CATEGORY}/${PN}, so that the sequential search would not be necessary. We should do that later if we decide to modify the vdb_metadata.pickle format in a backward-incompatible way. -- Thanks, Zac