From 238b0337a47208fd72f24a7ba51aa0bcceeb858b Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Sun, 10 Dec 2006 08:09:34 +0000 Subject: [PATCH] Use dep_getcpv() inside dep_expand() for code sharing and caching. svn path=/main/trunk/; revision=5252 --- pym/portage.py | 20 +++++--------------- 1 file 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 -- 2.26.2