summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2009-09-14 06:02:36 +0000
committerZac Medico <zmedico@gentoo.org>2009-09-14 06:02:36 +0000
commit836d4220d6d00b71bcf26bfd04a088f70cd71957 (patch)
tree8279e02fe5bd308867971c6c6fa44724f3eb2bd8
parenta0c41d09a875e925e52bce2fc1f3a892f5d546ae (diff)
downloadportage-836d4220d6d00b71bcf26bfd04a088f70cd71957.tar.gz
portage-836d4220d6d00b71bcf26bfd04a088f70cd71957.tar.bz2
portage-836d4220d6d00b71bcf26bfd04a088f70cd71957.zip
Use the Atom class to implement dep_getkey(), and fall back to legacy code
when necessary for backward compatibility. svn path=/main/trunk/; revision=14254
-rw-r--r--pym/portage/dep.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/pym/portage/dep.py b/pym/portage/dep.py
index 847c76eae..8dbcdd657 100644
--- 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)