summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2006-12-10 08:09:34 +0000
committerZac Medico <zmedico@gentoo.org>2006-12-10 08:09:34 +0000
commit238b0337a47208fd72f24a7ba51aa0bcceeb858b (patch)
tree9c7f19e0555ddefb1c83ab0576e805521985c84a
parent3e35fe55c19a8de1f2e6bf30f827c2c1f9606488 (diff)
downloadportage-238b0337a47208fd72f24a7ba51aa0bcceeb858b.tar.gz
portage-238b0337a47208fd72f24a7ba51aa0bcceeb858b.tar.bz2
portage-238b0337a47208fd72f24a7ba51aa0bcceeb858b.zip
Use dep_getcpv() inside dep_expand() for code sharing and caching.
svn path=/main/trunk/; revision=5252
-rw-r--r--pym/portage.py20
1 files changed, 5 insertions, 15 deletions
diff --git a/pym/portage.py b/pym/portage.py
index d84b6bcea..7b0d17cc0 100644
--- a/pym/portage.py
+++ b/pym/portage.py
@@ -3837,21 +3837,11 @@ def dep_expand(mydep, mydb=None, use_cache=1, settings=None):
return mydep
if mydep[0]=="*":
mydep=mydep[1:]
- prefix=""
- postfix=""
- if mydep[-1]=="*":
- mydep=mydep[:-1]
- postfix="*"
- if mydep[:2] in [ ">=", "<=" ]:
- prefix=mydep[:2]
- mydep=mydep[2:]
- elif mydep[:1] in "=<>~!":
- prefix=mydep[:1]
- mydep=mydep[1:]
- colon = mydep.rfind(":")
- if colon != -1:
- postfix = mydep[colon:]
- mydep = mydep[:colon]
+ orig_dep = mydep
+ mydep = dep_getcpv(orig_dep)
+ myindex = orig_dep.index(mydep)
+ prefix = orig_dep[:myindex]
+ postfix = orig_dep[myindex+len(mydep):]
return prefix + cpv_expand(
mydep, mydb=mydb, use_cache=use_cache, settings=settings) + postfix