1 |
commit: 768096f120ac1aec161416e284eeec97ef376b3d |
2 |
Author: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
3 |
AuthorDate: Fri Feb 11 05:49:11 2011 +0000 |
4 |
Commit: Brian Dolbec <brian.dolbec <AT> gmail <DOT> com> |
5 |
CommitDate: Fri Feb 11 05:50:59 2011 +0000 |
6 |
URL: http://git.overlays.gentoo.org/gitweb/?p=proj/gentoolkit.git;a=commit;h=768096f1 |
7 |
|
8 |
apply djanderson's idea for a simpler/better fix to bug 353430 and commit 000ce49860b253ad6c917c5a58bc0ff31225134a for |
9 |
use conditionals causing errors in equery results. |
10 |
|
11 |
--- |
12 |
pym/gentoolkit/atom.py | 17 ++++++++++------- |
13 |
pym/gentoolkit/dependencies.py | 4 ++-- |
14 |
pym/gentoolkit/helpers.py | 14 +------------- |
15 |
3 files changed, 13 insertions(+), 22 deletions(-) |
16 |
|
17 |
diff --git a/pym/gentoolkit/atom.py b/pym/gentoolkit/atom.py |
18 |
index fe9adaa..7282fac 100644 |
19 |
--- a/pym/gentoolkit/atom.py |
20 |
+++ b/pym/gentoolkit/atom.py |
21 |
@@ -81,10 +81,13 @@ class Atom(portage.dep.Atom, CPV): |
22 |
if self.blocker.overlap.forbid != other.blocker.overlap.forbid: |
23 |
return False |
24 |
|
25 |
+ if self.use_conditional != other.use_conditional: |
26 |
+ return False |
27 |
+ |
28 |
# Don't believe Portage has something like this |
29 |
#c = cmp(self.negate_vers, other.negate_vers) |
30 |
#if c: |
31 |
- # return c |
32 |
+ # return c |
33 |
|
34 |
if self.slot != other.slot: |
35 |
return False |
36 |
@@ -133,7 +136,7 @@ class Atom(portage.dep.Atom, CPV): |
37 |
# Don't believe Portage has something like this |
38 |
#c = cmp(self.negate_vers, other.negate_vers) |
39 |
#if c: |
40 |
- # return c |
41 |
+ # return c |
42 |
|
43 |
if self.slot != other.slot: |
44 |
if self.slot is None: |
45 |
@@ -229,8 +232,8 @@ class Atom(portage.dep.Atom, CPV): |
46 |
|
47 |
# TODO: Uncomment when Portage's Atom supports repo |
48 |
#if (self.repo_name is not None and other.repo_name is not None and |
49 |
- # self.repo_name != other.repo_name): |
50 |
- # return False |
51 |
+ # self.repo_name != other.repo_name): |
52 |
+ # return False |
53 |
|
54 |
# Use deps are similar: if one of us forces a flag on and the |
55 |
# other forces it off we do not intersect. If only one of us |
56 |
@@ -247,9 +250,9 @@ class Atom(portage.dep.Atom, CPV): |
57 |
if flag[0] == '-' and flag[1:] in flags: |
58 |
return False |
59 |
|
60 |
- # Remaining thing to check is version restrictions. Get the |
61 |
- # ones we can check without actual version comparisons out of |
62 |
- # the way first. |
63 |
+ # Remaining thing to check is version restrictions. Get the |
64 |
+ # ones we can check without actual version comparisons out of |
65 |
+ # the way first. |
66 |
|
67 |
# If one of us is unversioned we intersect: |
68 |
if not self.operator or not other.operator: |
69 |
|
70 |
diff --git a/pym/gentoolkit/dependencies.py b/pym/gentoolkit/dependencies.py |
71 |
index 6aadc35..feced63 100644 |
72 |
--- a/pym/gentoolkit/dependencies.py |
73 |
+++ b/pym/gentoolkit/dependencies.py |
74 |
@@ -19,7 +19,7 @@ from portage.dep import paren_reduce |
75 |
from gentoolkit import errors |
76 |
from gentoolkit.atom import Atom |
77 |
from gentoolkit.cpv import CPV |
78 |
-from gentoolkit.helpers import uniqify_atoms |
79 |
+from gentoolkit.helpers import uniqify |
80 |
from gentoolkit.dbapi import PORTDB, VARDB |
81 |
from gentoolkit.query import Query |
82 |
|
83 |
@@ -243,7 +243,7 @@ class Dependencies(Query): |
84 |
try: |
85 |
all_depends = depcache[pkgdep] |
86 |
except KeyError: |
87 |
- all_depends = uniqify_atoms(pkgdep.get_all_depends()) |
88 |
+ all_depends = uniqify(pkgdep.get_all_depends()) |
89 |
depcache[pkgdep] = all_depends |
90 |
|
91 |
dep_is_displayed = False |
92 |
|
93 |
diff --git a/pym/gentoolkit/helpers.py b/pym/gentoolkit/helpers.py |
94 |
index cf1b138..cd8b763 100644 |
95 |
--- a/pym/gentoolkit/helpers.py |
96 |
+++ b/pym/gentoolkit/helpers.py |
97 |
@@ -7,7 +7,7 @@ |
98 |
"""Miscellaneous helper functions and classes. |
99 |
|
100 |
@note: find_* functions that previously lived here have moved to |
101 |
- the query module, where they are called as: Query('portage').find_*(). |
102 |
+ the query module, where they are called as: Query('portage').find_*(). |
103 |
""" |
104 |
|
105 |
__all__ = ( |
106 |
@@ -476,16 +476,4 @@ def uniqify(seq, preserve_order=True): |
107 |
|
108 |
return result |
109 |
|
110 |
-def uniqify_atoms(seq): |
111 |
- """Return a uniqified list.""" |
112 |
- seen = set() |
113 |
- result = [] |
114 |
- for x in seq: |
115 |
- dep = x.get_depstr() |
116 |
- if dep not in seen: |
117 |
- result.append(x) |
118 |
- seen.add(dep) |
119 |
- |
120 |
- return result |
121 |
- |
122 |
# vim: set ts=4 sw=4 tw=79: |