Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r11319 - main/trunk/pym/_emerge
Date: Sat, 02 Aug 2008 07:24:02
Message-Id: E1KPBT5-0006Vu-Pz@stork.gentoo.org
1 Author: zmedico
2 Date: 2008-08-02 07:23:57 +0000 (Sat, 02 Aug 2008)
3 New Revision: 11319
4
5 Modified:
6 main/trunk/pym/_emerge/__init__.py
7 Log:
8 Handle missing sets, to avoid KeyError raised from unmerge().
9
10
11 Modified: main/trunk/pym/_emerge/__init__.py
12 ===================================================================
13 --- main/trunk/pym/_emerge/__init__.py 2008-08-02 01:35:40 UTC (rev 11318)
14 +++ main/trunk/pym/_emerge/__init__.py 2008-08-02 07:23:57 UTC (rev 11319)
15 @@ -10370,6 +10370,7 @@
16 # we don't want to unmerge packages that are still listed in user-editable package sets
17 # listed in "world" as they would be remerged on the next update of "world" or the
18 # relevant package sets.
19 + unknown_sets = set()
20 for cp in xrange(len(pkgmap)):
21 for cpv in pkgmap[cp]["selected"].copy():
22 try:
23 @@ -10385,6 +10386,17 @@
24 # removed from "world" later on)
25 if s in root_config.setconfig.active or (s == "world" and not root_config.setconfig.active):
26 continue
27 +
28 + if s not in sets:
29 + if s in unknown_sets:
30 + continue
31 + unknown_sets.add(s)
32 + out = portage.output.EOutput()
33 + out.eerror(("Unknown set '@%s' in " + \
34 + "%svar/lib/portage/world_sets") % \
35 + (s, root_config.root))
36 + continue
37 +
38 # only check instances of EditablePackageSet as other classes are generally used for
39 # special purposes and can be ignored here (and are usually generated dynamically, so the
40 # user can't do much about them anyway)