aboutsummaryrefslogtreecommitdiffstats
path: root/meta/classes/distrodata.bbclass
diff options
context:
space:
mode:
authorAlexander Kanavin <alexander.kanavin@linux.intel.com>2017-11-14 16:57:28 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2017-11-29 23:41:36 +0000
commit591d57877d3d3e659d78c0ed33f4c515e3f6f8fb (patch)
tree669b3eb82ece3f4620b190a93215f32ae2136b46 /meta/classes/distrodata.bbclass
parent090eb9efdb2204673b1d569582813ea8860c8570 (diff)
downloadopenembedded-core-contrib-591d57877d3d3e659d78c0ed33f4c515e3f6f8fb.tar.gz
distrodata.bbclass: make upstream version check more useful for git upstreams
Specifically: 1) remove +git${SRCPV} stuff from comparison and output; it's just unnecessary clutter; 2) write the commit id of the latest version tag into the output; this saves quite a bit of trouble of manually checking what that commit id is when doing version updates; 3) when UPSTREAM_CHECK_COMMITS is set, ignore the tags altogether; instead check if the latest commit is different to the one we use, and if so, report that the recipe can be updated to said commit (which is also written into the output, as in 2). Multiple recipes are failing the upstream check because they never issue tags, now we can fix them. Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com> Signed-off-by: Ross Burton <ross.burton@intel.com>
Diffstat (limited to 'meta/classes/distrodata.bbclass')
-rw-r--r--meta/classes/distrodata.bbclass26
1 files changed, 8 insertions, 18 deletions
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index c85f7b3474..b0f4ecea09 100644
--- a/meta/classes/distrodata.bbclass
+++ b/meta/classes/distrodata.bbclass
@@ -272,24 +272,15 @@ python do_checkpkg() {
if upstream_check_unreliable == "1":
return "N/A", "CHECK_IS_UNRELIABLE"
- try:
- uv = oe.recipeutils.get_recipe_upstream_version(localdata)
- pupver = uv['version'] if uv['version'] else "N/A"
- except Exception as e:
- pupver = "N/A"
+ uv = oe.recipeutils.get_recipe_upstream_version(localdata)
+ pupver = uv['version'] if uv['version'] else "N/A"
+ pversion = uv['current_version']
+ revision = uv['revision'] if uv['revision'] else "N/A"
if pupver == "N/A":
pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN"
else:
- src_uri = (localdata.getVar('SRC_URI') or '').split()
- if src_uri:
- uri_type, _, _, _, _, _ = decodeurl(src_uri[0])
- else:
- uri_type = "none"
- pv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pversion, uri_type)
- upv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pupver, uri_type)
-
- cmp = vercmp_string(pv, upv)
+ cmp = vercmp_string(pversion, pupver)
if cmp == -1:
pstatus = "UPDATE" if not upstream_version_unknown else "KNOWN_BROKEN"
elif cmp == 0:
@@ -297,7 +288,7 @@ python do_checkpkg() {
else:
pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN"
- return pupver, pstatus
+ return pversion, pupver, pstatus, revision
"""initialize log files."""
@@ -334,7 +325,6 @@ python do_checkpkg() {
pdesc = localdata.getVar('DESCRIPTION')
pgrp = localdata.getVar('SECTION')
- pversion = localdata.getVar('PV')
plicense = localdata.getVar('LICENSE')
psection = localdata.getVar('SECTION')
phome = localdata.getVar('HOMEPAGE')
@@ -345,7 +335,7 @@ python do_checkpkg() {
psrcuri = localdata.getVar('SRC_URI')
maintainer = localdata.getVar('RECIPE_MAINTAINER')
- pupver, pstatus = get_upstream_version_and_status()
+ pversion, pupver, pstatus, prevision = get_upstream_version_and_status()
if psrcuri:
psrcuri = psrcuri.split()[0]
@@ -358,7 +348,7 @@ python do_checkpkg() {
with open(logfile, "a") as f:
writer = csv.writer(f, delimiter='\t')
writer.writerow([pname, pversion, pupver, plicense, psection, phome,
- prelease, pdepends, pbugtracker, ppe, pdesc, pstatus, pupver,
+ prelease, pdepends, pbugtracker, ppe, pdesc, pstatus, prevision,
psrcuri, maintainer, no_upgr_reason])
f.close()
bb.utils.unlockfile(lf)