summaryrefslogtreecommitdiffstats
path: root/meta/classes/package.bbclass
diff options
context:
space:
mode:
authorMike Looijmans <mike.looijmans@topic.nl>2015-01-10 14:46:42 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-01-23 11:36:31 +0000
commita9102e5bf9ea2d342cd09ccc603ec160f18a355a (patch)
tree83de0860062680f2190869cedd8bae77facb2b74 /meta/classes/package.bbclass
parent8bab098c36e2a10107b368dc94448c536a536e40 (diff)
downloadpoky-a9102e5bf9ea2d342cd09ccc603ec160f18a355a.tar.gz
package.bbclass: Let PR server update PKGV, not PV
PV is the package version as we need it to be during the build. PKGV is the final version as it ends up in the package, and defaults to PV. The packager handled builds without PR-server by replacing the AUTOINC string in PKGV, but when the PR-server is being used, the script replaces the contents of PKGV with the PV if the PV contains "AUTOINC". Thus the packager overrides any change to PKGV the recipe might have made. This breaks classes like gitpkgv that provide a correctly numbered PKGV, the number as calculated by that class will simply be replaced with a 0-based index from the PR-server. This patch makes the packager look at the PKGV version instead of the PV, and update the PKGV only based on the PKGV contents as set by the recipe. See also the discussion here: http://lists.openembedded.org/pipermail/openembedded-core/2015-January/100329.html From investigating the history of the code and changes in the past year, the use of "pv" instead of "pkgv" appears to be just an oversight, introduced in: commit b27b438221e16ac3df6ac66d761b77e3bd43db67 "prs: use the PRServer to replace the BB_URI_LOCALCOUNT functionality" A later commit 865d001de168915a5796e5c760f96bdd04cebd61 "package/prserv: Merge two similar functions into one" silently fixed this only for the case without PR-server by using pkgv there. (From OE-Core rev: 7895c0a67d381ff66668fca5207bd196f36c91db) Signed-off-by: Mike Looijmans <mike.looijmans@topic.nl> Signed-off-by: Ross Burton <ross.burton@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/package.bbclass')
-rw-r--r--meta/classes/package.bbclass7
1 files changed, 4 insertions, 3 deletions
diff --git a/meta/classes/package.bbclass b/meta/classes/package.bbclass
index 31c9e080ed..f6c92cb620 100644
--- a/meta/classes/package.bbclass
+++ b/meta/classes/package.bbclass
@@ -403,9 +403,10 @@ python package_get_auto_pr() {
403 if not (host is None): 403 if not (host is None):
404 d.setVar("PRSERV_HOST", host) 404 d.setVar("PRSERV_HOST", host)
405 405
406 pkgv = d.getVar("PKGV", True)
407
406 # PR Server not active, handle AUTOINC 408 # PR Server not active, handle AUTOINC
407 if not d.getVar('PRSERV_HOST', True): 409 if not d.getVar('PRSERV_HOST', True):
408 pkgv = d.getVar("PKGV", True)
409 if 'AUTOINC' in pkgv: 410 if 'AUTOINC' in pkgv:
410 d.setVar("PKGV", pkgv.replace("AUTOINC", "0")) 411 d.setVar("PKGV", pkgv.replace("AUTOINC", "0"))
411 return 412 return
@@ -428,11 +429,11 @@ python package_get_auto_pr() {
428 if conn is None: 429 if conn is None:
429 conn = oe.prservice.prserv_make_conn(d) 430 conn = oe.prservice.prserv_make_conn(d)
430 if conn is not None: 431 if conn is not None:
431 if "AUTOINC" in pv: 432 if "AUTOINC" in pkgv:
432 srcpv = bb.fetch2.get_srcrev(d) 433 srcpv = bb.fetch2.get_srcrev(d)
433 base_ver = "AUTOINC-%s" % version[:version.find(srcpv)] 434 base_ver = "AUTOINC-%s" % version[:version.find(srcpv)]
434 value = conn.getPR(base_ver, pkgarch, srcpv) 435 value = conn.getPR(base_ver, pkgarch, srcpv)
435 d.setVar("PKGV", pv.replace("AUTOINC", str(value))) 436 d.setVar("PKGV", pkgv.replace("AUTOINC", str(value)))
436 437
437 auto_pr = conn.getPR(version, pkgarch, checksum) 438 auto_pr = conn.getPR(version, pkgarch, checksum)
438 except Exception as e: 439 except Exception as e: