Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r12306 - main/branches/2.1.6/pym/_emerge
Date: Thu, 25 Dec 2008 01:09:42
Message-Id: E1LFejM-00017V-Vk@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-12-25 01:09:39 +0000 (Thu, 25 Dec 2008)
3 New Revision: 12306
4
5 Modified:
6 main/branches/2.1.6/pym/_emerge/__init__.py
7 Log:
8 Fix --clean <atom> so that it considers all packages within a given slot when
9 it's deciding which packages to keep, rather than just considering the ones
10 matched by the given atom. Any packages not matching the given atom are protected
11 from being unmerged. Thanks to Mart Raudsepp <leio@g.o> for reporting.
12 (trunk r12272)
13
14 Modified: main/branches/2.1.6/pym/_emerge/__init__.py
15 ===================================================================
16 --- main/branches/2.1.6/pym/_emerge/__init__.py 2008-12-25 01:09:24 UTC (rev 12305)
17 +++ main/branches/2.1.6/pym/_emerge/__init__.py 2008-12-25 01:09:39 UTC (rev 12306)
18 @@ -11048,7 +11048,14 @@
19 if myslot not in slotmap:
20 slotmap[myslot] = {}
21 slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)] = mypkg
22 -
23 +
24 + for mypkg in vartree.dbapi.cp_list(
25 + portage.dep_getkey(mymatch[0])):
26 + myslot = vartree.getslot(mypkg)
27 + if myslot not in slotmap:
28 + slotmap[myslot] = {}
29 + slotmap[myslot][vartree.dbapi.cpv_counter(mypkg)] = mypkg
30 +
31 for myslot in slotmap:
32 counterkeys = slotmap[myslot].keys()
33 if not counterkeys:
34 @@ -11057,6 +11064,14 @@
35 pkgmap[mykey]["protected"].add(
36 slotmap[myslot][counterkeys[-1]])
37 del counterkeys[-1]
38 +
39 + for counter in counterkeys[:]:
40 + mypkg = slotmap[myslot][counter]
41 + if mypkg not in mymatch:
42 + counterkeys.remove(counter)
43 + pkgmap[mykey]["protected"].add(
44 + slotmap[myslot][counter])
45 +
46 #be pretty and get them in order of merge:
47 for ckey in counterkeys:
48 mypkg = slotmap[myslot][ckey]