diff options
author | Alexander Kanavin <alexander.kanavin@linux.intel.com> | 2017-11-14 16:57:28 +0200 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2017-11-30 10:49:22 +0000 |
commit | c5999210254958ff1c3452c92678dfdda3e66aa7 (patch) | |
tree | 4e06199a241aeb3ff54699daad17d5fb1b3694c2 /meta/classes | |
parent | 4f2b00b67373aed2029b11f1753b0c59107d27fb (diff) | |
download | poky-c5999210254958ff1c3452c92678dfdda3e66aa7.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.
(From OE-Core rev: 591d57877d3d3e659d78c0ed33f4c515e3f6f8fb)
Signed-off-by: Alexander Kanavin <alexander.kanavin@linux.intel.com>
Signed-off-by: Ross Burton <ross.burton@intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes')
-rw-r--r-- | meta/classes/distrodata.bbclass | 26 |
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() { | |||
272 | if upstream_check_unreliable == "1": | 272 | if upstream_check_unreliable == "1": |
273 | return "N/A", "CHECK_IS_UNRELIABLE" | 273 | return "N/A", "CHECK_IS_UNRELIABLE" |
274 | 274 | ||
275 | try: | 275 | uv = oe.recipeutils.get_recipe_upstream_version(localdata) |
276 | uv = oe.recipeutils.get_recipe_upstream_version(localdata) | 276 | pupver = uv['version'] if uv['version'] else "N/A" |
277 | pupver = uv['version'] if uv['version'] else "N/A" | 277 | pversion = uv['current_version'] |
278 | except Exception as e: | 278 | revision = uv['revision'] if uv['revision'] else "N/A" |
279 | pupver = "N/A" | ||
280 | 279 | ||
281 | if pupver == "N/A": | 280 | if pupver == "N/A": |
282 | pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN" | 281 | pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN" |
283 | else: | 282 | else: |
284 | src_uri = (localdata.getVar('SRC_URI') or '').split() | 283 | cmp = vercmp_string(pversion, pupver) |
285 | if src_uri: | ||
286 | uri_type, _, _, _, _, _ = decodeurl(src_uri[0]) | ||
287 | else: | ||
288 | uri_type = "none" | ||
289 | pv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pversion, uri_type) | ||
290 | upv, _, _ = oe.recipeutils.get_recipe_pv_without_srcpv(pupver, uri_type) | ||
291 | |||
292 | cmp = vercmp_string(pv, upv) | ||
293 | if cmp == -1: | 284 | if cmp == -1: |
294 | pstatus = "UPDATE" if not upstream_version_unknown else "KNOWN_BROKEN" | 285 | pstatus = "UPDATE" if not upstream_version_unknown else "KNOWN_BROKEN" |
295 | elif cmp == 0: | 286 | elif cmp == 0: |
@@ -297,7 +288,7 @@ python do_checkpkg() { | |||
297 | else: | 288 | else: |
298 | pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN" | 289 | pstatus = "UNKNOWN" if upstream_version_unknown else "UNKNOWN_BROKEN" |
299 | 290 | ||
300 | return pupver, pstatus | 291 | return pversion, pupver, pstatus, revision |
301 | 292 | ||
302 | 293 | ||
303 | """initialize log files.""" | 294 | """initialize log files.""" |
@@ -334,7 +325,6 @@ python do_checkpkg() { | |||
334 | 325 | ||
335 | pdesc = localdata.getVar('DESCRIPTION') | 326 | pdesc = localdata.getVar('DESCRIPTION') |
336 | pgrp = localdata.getVar('SECTION') | 327 | pgrp = localdata.getVar('SECTION') |
337 | pversion = localdata.getVar('PV') | ||
338 | plicense = localdata.getVar('LICENSE') | 328 | plicense = localdata.getVar('LICENSE') |
339 | psection = localdata.getVar('SECTION') | 329 | psection = localdata.getVar('SECTION') |
340 | phome = localdata.getVar('HOMEPAGE') | 330 | phome = localdata.getVar('HOMEPAGE') |
@@ -345,7 +335,7 @@ python do_checkpkg() { | |||
345 | psrcuri = localdata.getVar('SRC_URI') | 335 | psrcuri = localdata.getVar('SRC_URI') |
346 | maintainer = localdata.getVar('RECIPE_MAINTAINER') | 336 | maintainer = localdata.getVar('RECIPE_MAINTAINER') |
347 | 337 | ||
348 | pupver, pstatus = get_upstream_version_and_status() | 338 | pversion, pupver, pstatus, prevision = get_upstream_version_and_status() |
349 | 339 | ||
350 | if psrcuri: | 340 | if psrcuri: |
351 | psrcuri = psrcuri.split()[0] | 341 | psrcuri = psrcuri.split()[0] |
@@ -358,7 +348,7 @@ python do_checkpkg() { | |||
358 | with open(logfile, "a") as f: | 348 | with open(logfile, "a") as f: |
359 | writer = csv.writer(f, delimiter='\t') | 349 | writer = csv.writer(f, delimiter='\t') |
360 | writer.writerow([pname, pversion, pupver, plicense, psection, phome, | 350 | writer.writerow([pname, pversion, pupver, plicense, psection, phome, |
361 | prelease, pdepends, pbugtracker, ppe, pdesc, pstatus, pupver, | 351 | prelease, pdepends, pbugtracker, ppe, pdesc, pstatus, prevision, |
362 | psrcuri, maintainer, no_upgr_reason]) | 352 | psrcuri, maintainer, no_upgr_reason]) |
363 | f.close() | 353 | f.close() |
364 | bb.utils.unlockfile(lf) | 354 | bb.utils.unlockfile(lf) |