From: Alexander Kanavin <alexander.kanavin@linux.intel.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH 01/27] distrodata.bbclass: make upstream version check more useful for git upstreams
Date: Tue, 14 Nov 2017 16:57:28 +0200 [thread overview]
Message-ID: <20171114145754.9643-1-alexander.kanavin@linux.intel.com> (raw)
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>
---
meta/classes/distrodata.bbclass | 26 ++++++++----------------
meta/lib/oe/recipeutils.py | 44 +++++++++++++++++------------------------
2 files changed, 26 insertions(+), 44 deletions(-)
diff --git a/meta/classes/distrodata.bbclass b/meta/classes/distrodata.bbclass
index c85f7b3474f..b0f4ecea09f 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)
diff --git a/meta/lib/oe/recipeutils.py b/meta/lib/oe/recipeutils.py
index a1e191afc7b..4e0859e6d90 100644
--- a/meta/lib/oe/recipeutils.py
+++ b/meta/lib/oe/recipeutils.py
@@ -900,25 +900,25 @@ def get_recipe_upstream_version(rd):
FetchError when don't have network access or upstream site don't response.
NoMethodError when uri latest_versionstring method isn't implemented.
- Returns a dictonary with version, type and datetime.
+ Returns a dictonary with version, repository revision, current_version, type and datetime.
Type can be A for Automatic, M for Manual and U for Unknown.
"""
from bb.fetch2 import decodeurl
from datetime import datetime
ru = {}
+ ru['current_version'] = rd.getVar('PV')
ru['version'] = ''
ru['type'] = 'U'
ru['datetime'] = ''
-
- pv = rd.getVar('PV')
+ ru['revision'] = ''
# XXX: If don't have SRC_URI means that don't have upstream sources so
# returns the current recipe version, so that upstream version check
# declares a match.
src_uris = rd.getVar('SRC_URI')
if not src_uris:
- ru['version'] = pv
+ ru['version'] = ru['current_version']
ru['type'] = 'M'
ru['datetime'] = datetime.now()
return ru
@@ -927,6 +927,9 @@ def get_recipe_upstream_version(rd):
src_uri = src_uris.split()[0]
uri_type, _, _, _, _, _ = decodeurl(src_uri)
+ (pv, pfx, sfx) = get_recipe_pv_without_srcpv(rd.getVar('PV'), uri_type)
+ ru['current_version'] = pv
+
manual_upstream_version = rd.getVar("RECIPE_UPSTREAM_VERSION")
if manual_upstream_version:
# manual tracking of upstream version.
@@ -947,33 +950,22 @@ def get_recipe_upstream_version(rd):
ru['datetime'] = datetime.now()
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)
-
- # if contains revision but not upversion use current pv
- if upversion == '' and revision:
- upversion = pv
-
- if upversion:
- tmp = upversion
- upversion = ''
-
- if pfx:
- upversion = pfx + tmp
- else:
- upversion = tmp
-
- if sfx:
- upversion = upversion + sfx + revision[:10]
+ if rd.getVar("UPSTREAM_CHECK_COMMITS") == "1":
+ revision = ud.method.latest_revision(ud, rd, 'default')
+ upversion = pv
+ if revision != rd.getVar("SRCREV"):
+ upversion = upversion + "-new-commits-available"
+ else:
+ pupver = ud.method.latest_versionstring(ud, rd)
+ (upversion, revision) = pupver
if upversion:
ru['version'] = upversion
ru['type'] = 'A'
+ if revision:
+ ru['revision'] = revision
+
ru['datetime'] = datetime.now()
return ru
--
2.15.0
next reply other threads:[~2017-11-14 14:57 UTC|newest]
Thread overview: 35+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-14 14:57 Alexander Kanavin [this message]
2017-11-14 14:57 ` [PATCH 02/27] oe-core: take UPSTREAM_CHECK_COMMITS into use where possible Alexander Kanavin
2017-11-14 14:57 ` [PATCH 03/27] python-scons: fix upstream version check Alexander Kanavin
2017-11-14 14:57 ` [PATCH 04/27] i2c-tools: " Alexander Kanavin
2017-11-14 14:57 ` [PATCH 05/27] python3-pycairo: " Alexander Kanavin
2017-11-14 14:57 ` [PATCH 06/27] libcheck: " Alexander Kanavin
2017-11-14 14:57 ` [PATCH 07/27] rpm: upstream version is now known Alexander Kanavin
2017-11-14 14:57 ` [PATCH 08/27] glib-2.0: update to 2.54.2 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 09/27] glib-networking: update to 2.54.1 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 10/27] dtc: update to 1.4.5 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 11/27] libdnf: update to 0.11.1 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 12/27] librepo: update to 1.8.1 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 13/27] dnf: update to 2.7.5 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 14/27] gobject-introspection: update to 1.54.1 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 15/27] gstreamer1.0-plugins: disable introspection on mips64 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 16/27] gnome-desktop3: Update to 3.26.2 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 17/27] webkitgtk: update to 2.18.3 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 18/27] psmisc: update to 23.0 Alexander Kanavin
2017-11-17 0:25 ` Burton, Ross
2017-11-17 0:35 ` Burton, Ross
2017-11-17 7:10 ` Alexander Kanavin
2017-11-14 14:57 ` [PATCH 19/27] btrfs-tools: update to 4.13.3 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 20/27] expect: update to 5.45.3 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 21/27] libpciaccess: update to 0.14 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 22/27] icu: update to 60.1 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 23/27] harfbuzz: update to 1.7.0 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 24/27] lighttpd: update to 1.4.48 Alexander Kanavin
2017-11-14 18:29 ` Leonardo Sandoval
2017-11-15 10:12 ` Alexander Kanavin
2017-11-14 14:57 ` [PATCH 25/27] libxslt: update to 1.1.32 Alexander Kanavin
2017-11-14 14:57 ` [PATCH 26/27] ffmpeg: update to 3.4 Alexander Kanavin
2017-11-14 19:41 ` Khem Raj
2017-11-14 20:31 ` Leonardo Sandoval
2017-11-15 10:14 ` Alexander Kanavin
2017-11-14 14:57 ` [PATCH 27/27] openssl: update to 1.0.2m, 1.1.0g Alexander Kanavin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20171114145754.9643-1-alexander.kanavin@linux.intel.com \
--to=alexander.kanavin@linux.intel.com \
--cc=openembedded-core@lists.openembedded.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox