Gentoo Archives: gentoo-commits

From: "Zac Medico (zmedico)" <zmedico@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] portage r13880 - in main/trunk/pym: _emerge portage
Date: Mon, 03 Aug 2009 20:49:12
Message-Id: E1MY4T0-0001rX-FO@stork.gentoo.org
1 Author: zmedico
2 Date: 2009-08-03 20:49:09 +0000 (Mon, 03 Aug 2009)
3 New Revision: 13880
4
5 Modified:
6 main/trunk/pym/_emerge/depgraph.py
7 main/trunk/pym/portage/dep.py
8 Log:
9 Bug #278729 - Add an Atom.without_use attribute which is identical to the
10 atom itself, except without any USE dependencies.
11
12
13 Modified: main/trunk/pym/_emerge/depgraph.py
14 ===================================================================
15 --- main/trunk/pym/_emerge/depgraph.py 2009-08-03 20:13:17 UTC (rev 13879)
16 +++ main/trunk/pym/_emerge/depgraph.py 2009-08-03 20:49:09 UTC (rev 13880)
17 @@ -712,14 +712,8 @@
18 else:
19 # Do not backtrack if only USE have to be changed in
20 # order to satisfy the dependency.
21 - atom_without_use = dep.atom
22 - if dep.atom.use:
23 - atom_without_use = portage.dep.remove_slot(dep.atom)
24 - if dep.atom.slot:
25 - atom_without_use += ":" + dep.atom.slot
26 - atom_without_use = portage.dep.Atom(atom_without_use)
27 dep_pkg, existing_node = \
28 - self._select_package(dep.root, atom_without_use,
29 + self._select_package(dep.root, atom.without_use,
30 onlydeps=dep.onlydeps)
31 if dep_pkg is None:
32 self._dynamic_config._runtime_pkg_mask.setdefault(
33 @@ -1845,12 +1839,6 @@
34 def _show_unsatisfied_dep(self, root, atom, myparent=None, arg=None):
35 atom = portage.dep.Atom(atom)
36 atom_set = InternalPackageSet(initial_atoms=(atom,))
37 - atom_without_use = atom
38 - if atom.use:
39 - atom_without_use = portage.dep.remove_slot(atom)
40 - if atom.slot:
41 - atom_without_use += ":" + atom.slot
42 - atom_without_use = portage.dep.Atom(atom_without_use)
43 xinfo = '"%s"' % atom
44 if arg:
45 xinfo='"%s"' % arg
46 @@ -1871,9 +1859,9 @@
47 continue
48 match = db.match
49 if hasattr(db, "xmatch"):
50 - cpv_list = db.xmatch("match-all", atom_without_use)
51 + cpv_list = db.xmatch("match-all", atom.without_use)
52 else:
53 - cpv_list = db.match(atom_without_use)
54 + cpv_list = db.match(atom.without_use)
55 # descending order
56 cpv_list.reverse()
57 for cpv in cpv_list:
58
59 Modified: main/trunk/pym/portage/dep.py
60 ===================================================================
61 --- main/trunk/pym/portage/dep.py 2009-08-03 20:13:17 UTC (rev 13879)
62 +++ main/trunk/pym/portage/dep.py 2009-08-03 20:49:09 UTC (rev 13880)
63 @@ -511,7 +511,7 @@
64 _atoms = weakref.WeakValueDictionary()
65
66 __slots__ = ("__weakref__", "blocker", "cp", "cpv", "operator",
67 - "slot", "use", "_str")
68 + "slot", "use", "without_use", "_str",)
69
70 class _blocker(object):
71 __slots__ = ("overlap",)
72 @@ -550,9 +550,16 @@
73 use = dep_getusedeps(s)
74 if use:
75 use = _use_dep(use)
76 + without_use = remove_slot(self)
77 + if self.slot is not None:
78 + without_use += ":" + self.slot
79 + without_use = Atom(without_use)
80 else:
81 use = None
82 + without_use = self
83 +
84 obj_setattr(self, "use", use)
85 + obj_setattr(self, "without_use", without_use)
86
87 def __setattr__(self, name, value):
88 raise AttributeError("Atom instances are immutable",