projects
/
portage.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a0c41d0
)
Use the Atom class to implement dep_getkey(), and fall back to legacy code
author
Zac Medico
<zmedico@gentoo.org>
Mon, 14 Sep 2009 06:02:36 +0000
(06:02 -0000)
committer
Zac Medico
<zmedico@gentoo.org>
Mon, 14 Sep 2009 06:02:36 +0000
(06:02 -0000)
when necessary for backward compatibility.
svn path=/main/trunk/; revision=14254
pym/portage/dep.py
patch
|
blob
|
history
diff --git
a/pym/portage/dep.py
b/pym/portage/dep.py
index 847c76eae83e4d8a6eace1101fb27169ab8141b7..8dbcdd65718f03edbca569adaf395d54523c6e6f 100644
(file)
--- a/
pym/portage/dep.py
+++ b/
pym/portage/dep.py
@@
-995,6
+995,16
@@
def dep_getkey(mydep):
cp = getattr(mydep, "cp", None)
if cp is not None:
return cp
+
+ try:
+ return Atom(mydep).cp
+ except InvalidAtom:
+ try:
+ return Atom('=' + mydep).cp
+ except InvalidAtom:
+ pass
+
+ # Fall back to legacy code for backward compatibility.
mydep = dep_getcpv(mydep)
if mydep and isspecific(mydep):
mysplit = catpkgsplit(mydep)