Gentoo Archives: gentoo-portage-dev

From: Zac Medico <zmedico@g.o>
To: gentoo-portage-dev@l.g.o
Subject: Re: [gentoo-portage-dev] [PATCH] VdbMetadataDelta.applyDelta: remove replaced versions (bug 547532)
Date: Thu, 07 May 2015 18:43:32
Message-Id: 554BB24D.4050903@gentoo.org
In Reply to: Re: [gentoo-portage-dev] [PATCH] VdbMetadataDelta.applyDelta: remove replaced versions (bug 547532) by Alexander Berntsen
1 On 05/07/2015 01:06 AM, Alexander Berntsen wrote:
2 > On 24/04/15 18:32, Zac Medico wrote:
3 >> - installed_package = installed_package[-1]
4 >> + try:
5 >> + self._vardb.match_unordered
6 >> + except AttributeError:
7 >> + installed_package = installed_package[-1]
8 >> + else:
9 >> + installed_package = portage.best(installed_package)
10 >> +
11 > This probably makes sense, but I don't understand how this helps to
12 > alleviate the problem. Would you mind explaining it?
13
14 This hunk just fixes to ensure that it shows the highest version in the
15 case were there are multiple slot installed. Otherwise, since
16 IndexedVardb returns unordered match results, it could randomly select a
17 lower version from another slot.
18
19 > The rest of the patch looks OK, even if I dislike the strong imperative
20 > nature of the replaced versions removal.
21
22 I'm open to suggestions if you can think of a nicer way to express it.
23 It certainly be nicer if the data from vdb_metadata.pickle had the
24 packages indexed by ${CATEGORY}/${PN}, so that the sequential search
25 would not be necessary. We should do that later if we decide to modify
26 the vdb_metadata.pickle format in a backward-incompatible way.
27 --
28 Thanks,
29 Zac

Replies