Skip to contentSkip to conversation

oe/recipeutils.py: get_recipe_upstream_info improvements

PATCH Superseded Aníbal Limón 1 participant 3 messages Jul 15, 2015

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

cover oe/recipeutils.py: get_recipe_upstream_info improvements

This patch set uses the new latest_versionstring method that returns the current revision of a version in SCM's this DEPENDS on,

http://lists.openembedded.org/pipermail/bitbake-devel/2015-July/006034.html

Aníbal Limón (2):
oe/recipeutils.py: get_recipe_upstream_info update to get revision recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pv

 meta/lib/oe/recipeutils.py | 34 +++++++++++++++++++++-------------
 1 file changed, 21 insertions(+), 13 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/2 oe/recipeutils.py: get_recipe_upstream_info update to get revision

Bitbake fetcher latest_versionstring now returns a tuple with (version,
revision) that helps SCM's like git to build current upstream version.

[YOCTO #7605]

---
 meta/lib/oe/recipeutils.py | 28 +++++++++++++++-------------
 1 file changed, 15 insertions(+), 13 deletions(-)
meta/lib/oe/recipeutils.py +15 -13
index ab50686..f3da864 100644
@@ -703,28 +703,30 @@ def get_recipe_upstream_version(rd):
     else:
         ud = bb.fetch2.FetchData(src_uri, rd)
         pupver = ud.method.latest_versionstring(ud, rd)
+        (upversion, revision) = pupver
 
+        # format git version version+gitAUTOINC+HASH
         if uri_type == 'git':
             (pv, pfx, sfx) = get_recipe_pv_without_srcpv(pv, uri_type)
 
-            revision = ud.method.latest_revision(ud, rd, ud.names[0])
+            # if contains revision but not upversion use current pv
+            if upversion == '' and revision:
+                upversion = pv
 
-            # if contains revision but not pupver use current pv
-            if pupver == '' and revision:
-                pupver = pv
-
-            if pupver != '':
-                tmp = pupver
-                pupver = ''
+            if upversion:
+                tmp = upversion
+                upversion = ''
 
                 if pfx:
-                    pupver = pfx
-                pupver = pupver + tmp
+                    upversion = pfx + tmp
+                else:
+                    upversion = tmp
+
                 if sfx:
-                    pupver = pupver + sfx + revision[:10]
+                    upversion = upversion + sfx + revision[:10]
 
-        if pupver != '':
-            ru['version'] = pupver
+        if upversion:
+            ru['version'] = upversion
             ru['type'] = 'A'
 
         ru['datetime'] = datetime.now()
Signature · 1 line
1.9.1
#2 lore raw

PATCH 2/2 recipeutils.py: get_recipe_pv_without_srcpv remove prefixes from pv

In reply to Aníbal Limón

Some recipes uses v or r prefixes in versions that makes wrong comparisions over recipes like lz4 r123 > 128.

---
 meta/lib/oe/recipeutils.py | 6 ++++++
 1 file changed, 6 insertions(+)
meta/lib/oe/recipeutils.py +6 -0
index f3da864..90dfba2 100644
@@ -644,6 +644,12 @@ def get_recipe_pv_without_srcpv(pv, uri_type):
             pv = m.group('ver')
             pfx = m.group('pfx')
             sfx = m.group('sfx')
+    else:
+        regex = re.compile("(?P<pfx>(v|r|))(?P<ver>((\d+[\.\-_]*)+))")
+        m = regex.match(pv)
+        if m:
+            pv = m.group('ver')
+            pfx = m.group('pfx')
 
     return (pv, pfx, sfx)
 
Signature · 1 line
1.9.1