summaryrefslogtreecommitdiffstats
path: root/meta/lib
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2015-06-01 16:04:29 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-06-08 17:34:05 +0100
commita8c746743ead644d98535c784528d81022d8f8a0 (patch)
treeb60a368c527eadf3a565da1de3e691cb97cbae50 /meta/lib
parent9634494087e56bc2dabb6ce929e8404f500f4c35 (diff)
downloadpoky-a8c746743ead644d98535c784528d81022d8f8a0.tar.gz
recipeutils: Improve get_recipe_pv_without_srcpv function
Use pv instead of rd this make the function more generic and avoid copy recipe data. (From OE-Core rev: c1c3c9a4fbaf01a905f79b0970f98ccb221a3935) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/lib')
-rw-r--r--meta/lib/oe/recipeutils.py12
1 files changed, 2 insertions, 10 deletions
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index 37efefb093..26bbf3e5c9 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -626,23 +626,17 @@ def replace_dir_vars(path, d):
626 path = path.replace(dirpath, '${%s}' % dirvars[dirpath]) 626 path = path.replace(dirpath, '${%s}' % dirvars[dirpath])
627 return path 627 return path
628 628
629def get_recipe_pv_without_srcpv(rd, uri_type): 629def get_recipe_pv_without_srcpv(pv, uri_type):
630 """ 630 """
631 Get PV without SRCPV common in SCM's for now only 631 Get PV without SRCPV common in SCM's for now only
632 support git. 632 support git.
633 633
634 Returns tuple with pv, prefix and suffix. 634 Returns tuple with pv, prefix and suffix.
635 """ 635 """
636 pv = ''
637 pfx = '' 636 pfx = ''
638 sfx = '' 637 sfx = ''
639 638
640 if uri_type == 'git': 639 if uri_type == 'git':
641 rd_tmp = rd.createCopy()
642
643 rd_tmp.setVar('SRCPV', '')
644 pv = rd_tmp.getVar('PV', True)
645
646 git_regex = re.compile("(?P<pfx>(v|))(?P<ver>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)") 640 git_regex = re.compile("(?P<pfx>(v|))(?P<ver>((\d+[\.\-_]*)+))(?P<sfx>(\+|)(git|)(r|)(AUTOINC|)(\+|))(?P<rev>.*)")
647 m = git_regex.match(pv) 641 m = git_regex.match(pv)
648 642
@@ -650,8 +644,6 @@ def get_recipe_pv_without_srcpv(rd, uri_type):
650 pv = m.group('ver') 644 pv = m.group('ver')
651 pfx = m.group('pfx') 645 pfx = m.group('pfx')
652 sfx = m.group('sfx') 646 sfx = m.group('sfx')
653 else:
654 pv = rd.getVar('PV', True)
655 647
656 return (pv, pfx, sfx) 648 return (pv, pfx, sfx)
657 649
@@ -704,7 +696,7 @@ def get_recipe_upstream_version(rd):
704 pupver = ud.method.latest_versionstring(ud, rd) 696 pupver = ud.method.latest_versionstring(ud, rd)
705 697
706 if uri_type == 'git': 698 if uri_type == 'git':
707 (pv, pfx, sfx) = get_recipe_pv_without_srcpv(rd, uri_type) 699 (pv, pfx, sfx) = get_recipe_pv_without_srcpv(pv, uri_type)
708 700
709 latest_revision = ud.method.latest_revision(ud, rd, ud.names[0]) 701 latest_revision = ud.method.latest_revision(ud, rd, ud.names[0])
710 702