Skip to contentSkip to conversation

distrodata: handle recipes with empty or absent SRC_URI in checkpkg()

PATCH New Alexander Kanavin 1 participant 2 messages Sep 25, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 distrodata: handle recipes with empty or absent SRC_URI in checkpkg()

---
 meta/classes/distrodata.bbclass | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)
meta/classes/distrodata.bbclass +8 -4
index 4168e43..e6eb3f3 100644
@@ -272,9 +272,10 @@ python do_checkpkg() {
 
         """first check whether a uri is provided"""
         src_uri = d.getVar('SRC_URI', True)
-        if not src_uri:
-                return
-        uri_type, _, _, _, _, _ = decodeurl(src_uri)
+        if src_uri:
+            uri_type, _, _, _, _, _ = decodeurl(src_uri)
+        else:
+            uri_type = "none"
 
         """initialize log files."""
         logpath = d.getVar('LOG_DIR', True)
@@ -354,7 +355,10 @@ python do_checkpkg() {
             elif cmp == 0:
                 pstatus = "MATCH"
 
-        psrcuri = psrcuri.split()[0]
+        if psrcuri:
+            psrcuri = psrcuri.split()[0]
+        else:
+            psrcuri = "none"
         pdepends = "".join(pdepends.split("\t"))
         pdesc = "".join(pdesc.split("\t"))
         no_upgr_reason = d.getVar('RECIPE_NO_UPDATE_REASON', True)
Signature · 1 line
2.1.4
#1 lore raw

PATCH 2/2 recipeutils.py: don't hardcode the upstream version as 1.0 when SRC_URI is empty or absent

Instead, simply return the version of the recipe, so that the upstream version checker will declare that they match.

---
 meta/lib/oe/recipeutils.py | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)
meta/lib/oe/recipeutils.py +5 -4
index 35b88d3..5fd5dcb 100644
@@ -732,11 +732,14 @@ def get_recipe_upstream_version(rd):
     ru['type'] = 'U'
     ru['datetime'] = ''
 
+    pv = rd.getVar('PV', True)
+
     # XXX: If don't have SRC_URI means that don't have upstream sources so
-    # returns 1.0.
+    # returns the current recipe version, so that upstream version check
+    # declares a match.
     src_uris = rd.getVar('SRC_URI', True)
     if not src_uris:
-        ru['version'] = '1.0'
+        ru['version'] = pv
         ru['type'] = 'M'
         ru['datetime'] = datetime.now()
         return ru
@@ -745,8 +748,6 @@ def get_recipe_upstream_version(rd):
     src_uri = src_uris.split()[0]
     uri_type, _, _, _, _, _ =  decodeurl(src_uri)
 
-    pv = rd.getVar('PV', True)
-
     manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION", True)
     if manual_upstream_version:
         # manual tracking of upstream version.
Signature · 1 line
2.1.4