From f160e90b2b61efd6069ff77e89cc7fadbed35cde Mon Sep 17 00:00:00 2001 From: Rob Cakebread Date: Fri, 8 Aug 2008 04:03:56 +0000 Subject: [PATCH] Revert to r15 git-svn-id: http://g-pypi.googlecode.com/svn/trunk@18 118783bc-b352-0410-bbc3-0f610f6f7ae8 --- g_pypi/enamer.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/g_pypi/enamer.py b/g_pypi/enamer.py index fc604a4..905a632 100644 --- a/g_pypi/enamer.py +++ b/g_pypi/enamer.py @@ -281,7 +281,7 @@ def sanitize_uri(uri): """ return uri -def get_vars(uri, up_pn, up_pv, pn="", pv="", my_pn="", my_pv=""): +def get_vars(uri, up_pn, up_pv, pn="", pv="", my_pn="", my_pv="", my_p=""): """ Determine P* and MY_* variables @@ -343,11 +343,6 @@ def get_vars(uri, up_pn, up_pv, pn="", pv="", my_pn="", my_pv=""): pn = pn.lower() p = "%s-%s" % (pn, pv) - #Check if we need to use MY_P based on src's uri - if my_p: - src_uri, my_p_raw = get_myp(uri) - else: - src_uri, my_p, my_p_raw = get_src_uri(uri) #Make sure we have a valid P if not portage_dep.isvalidatom("=dev-python/%s-%s" % (pn, pv)): @@ -372,6 +367,19 @@ def get_vars(uri, up_pn, up_pv, pn="", pv="", my_pn="", my_pv=""): my_p = my_p.replace(pn, "${PN}") my_p = my_p.replace(pv, "${PV}") + if my_pn and not my_p: + if my_pv: + my_p = '%s-%s' % (my_pn, my_pv) + elif not my_pv: + my_p = '%s-%s' % (my_pn, '${PV}') + my_pn = '' + + #Check if we need to use MY_P based on src's uri + if my_p: + src_uri, my_p_raw = get_myp(uri) + else: + src_uri, my_p, my_p_raw = get_src_uri(uri) + return {'pn': pn, 'pv': pv, 'p': p, -- 2.26.2