diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-03 13:07:18 +0000 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2013-03-05 12:28:06 +0000 |
commit | 49f33a42e93711c96fbb099f3e6ee7f092d7b356 (patch) | |
tree | 7f6daca2d7b3a95d096a3fc52c0311a5fc1770bf /meta | |
parent | fe81bd4f600877e63433184cfc2e22c33bb77db6 (diff) | |
download | openembedded-core-49f33a42e93711c96fbb099f3e6ee7f092d7b356.tar.gz openembedded-core-49f33a42e93711c96fbb099f3e6ee7f092d7b356.tar.bz2 openembedded-core-49f33a42e93711c96fbb099f3e6ee7f092d7b356.zip |
buildhistory: Allow the version backwards check to be disabled
When the PR service is not enabled, the versions can go backwards and there
are cases we don't want to know about this. This patch adds a variable
allowing these checks to be turned off whilst still using buildhistory.
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/buildhistory.bbclass | 18 |
1 files changed, 10 insertions, 8 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass index a20d03dae7..43780ad2da 100644 --- a/meta/classes/buildhistory.bbclass +++ b/meta/classes/buildhistory.bbclass @@ -14,6 +14,7 @@ BUILDHISTORY_DIR_PACKAGE = "${BUILDHISTORY_DIR}/packages/${MULTIMACH_TARGET_SYS} BUILDHISTORY_COMMIT ?= "0" BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>" BUILDHISTORY_PUSH_REPO ?= "" +BUILDHISTORY_CHECKVERBACKWARDS ?= "1" # Must inherit package first before changing PACKAGEFUNCS inherit package @@ -183,14 +184,15 @@ python buildhistory_emit_pkghistory() { # Find out what the last version was # Make sure the version did not decrease # - lastversion = getlastpkgversion(pkg) - if lastversion: - last_pkge = lastversion.pkge - last_pkgv = lastversion.pkgv - last_pkgr = lastversion.pkgr - r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr)) - if r < 0: - bb.error("Package version for package %s went backwards which would break package feeds from (%s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr)) + if d.getVar("BUILDHISTORY_CHECKVERBACKWARDS", True) == "1": + lastversion = getlastpkgversion(pkg) + if lastversion: + last_pkge = lastversion.pkge + last_pkgv = lastversion.pkgv + last_pkgr = lastversion.pkgr + r = bb.utils.vercmp((pkge, pkgv, pkgr), (last_pkge, last_pkgv, last_pkgr)) + if r < 0: + bb.error("Package version for package %s went backwards which would break package feeds from (%s:%s-%s to %s:%s-%s)" % (pkg, last_pkge, last_pkgv, last_pkgr, pkge, pkgv, pkgr)) pkginfo = PackageInfo(pkg) # Apparently the version can be different on a per-package basis (see Python) |