From: Rob Cakebread Date: Fri, 8 Aug 2008 04:14:40 +0000 (+0000) Subject: Revert to r2 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=c2fcaffb607f29e12427325309616d341986181b;p=g-pypi.git Revert to r2 git-svn-id: http://g-pypi.googlecode.com/svn/trunk@20 118783bc-b352-0410-bbc3-0f610f6f7ae8 --- diff --git a/g_pypi/enamer.py b/g_pypi/enamer.py index 905a632..fc604a4 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="", my_p=""): +def get_vars(uri, up_pn, up_pv, pn="", pv="", my_pn="", my_pv=""): """ Determine P* and MY_* variables @@ -343,6 +343,11 @@ def get_vars(uri, up_pn, up_pv, pn="", pv="", my_pn="", my_pv="", my_p=""): 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)): @@ -367,19 +372,6 @@ def get_vars(uri, up_pn, up_pv, pn="", pv="", my_pn="", my_pv="", my_p=""): 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,