From: Zac Medico Date: Sun, 10 Dec 2006 08:09:34 +0000 (-0000) Subject: Use dep_getcpv() inside dep_expand() for code sharing and caching. X-Git-Tag: v2.1.2~332 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=238b0337a47208fd72f24a7ba51aa0bcceeb858b;p=portage.git Use dep_getcpv() inside dep_expand() for code sharing and caching. svn path=/main/trunk/; revision=5252 --- 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