summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorConstantin Musca <constantinx.musca@intel.com>2013-02-27 17:37:24 +0200
committerRichard Purdie <richard.purdie@linuxfoundation.org>2013-03-07 11:14:37 +0000
commitd4e470322658af75db276ecbe8d906949541c872 (patch)
tree31ad7b30577ff17f9187c3b96497410092580f5e
parent6159ad1063f4be518d8f0a1c024f12fc16d13592 (diff)
downloadast2050-yocto-poky-d4e470322658af75db276ecbe8d906949541c872.zip
ast2050-yocto-poky-d4e470322658af75db276ecbe8d906949541c872.tar.gz
buildhistory.bbclass: add support for SRCREV logging
- create "latest_srcrev" for each recipe with the following format: ${BB_FILENAME},${SRC_URI},${SRCREV},${FROM_AUTOREV} [YOCTO #3041] (From OE-Core rev: f9acd756746e61b82b58d300f3ab13f3b086787d) Signed-off-by: Constantin Musca <constantinx.musca@intel.com> Signed-off-by: Saul Wold <sgw@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/buildhistory.bbclass23
1 files changed, 22 insertions, 1 deletions
diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 43780ad..07b3c1e 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -45,6 +45,11 @@ python buildhistory_emit_pkghistory() {
self.pr = "r0"
self.depends = ""
self.packages = ""
+ self.bbfile = ""
+ self.src_uri = ""
+ self.srcrev = ""
+ self.srcrev_autorev = ""
+
class PackageInfo:
def __init__(self, name):
@@ -152,6 +157,12 @@ python buildhistory_emit_pkghistory() {
pe = d.getVar('PE', True) or "0"
pv = d.getVar('PV', True)
pr = d.getVar('PR', True)
+
+ bbfile = d.getVar('BB_FILENAME', True)
+ src_uri = d.getVar('SRC_URI', True)
+ srcrev = d.getVar('SRCREV', True)
+ srcrev_autorev = 'yes' if d.getVar('SRCREV', False) == 'AUTOINC' else 'no'
+
packages = squashspaces(d.getVar('PACKAGES', True))
packagelist = packages.split()
@@ -160,7 +171,7 @@ python buildhistory_emit_pkghistory() {
else:
# Remove files for packages that no longer exist
for item in os.listdir(pkghistdir):
- if item != "latest":
+ if item != "latest" and item != "latest_srcrev":
if item not in packagelist:
subdir = os.path.join(pkghistdir, item)
for subfile in os.listdir(subdir):
@@ -172,6 +183,10 @@ python buildhistory_emit_pkghistory() {
rcpinfo.pv = pv
rcpinfo.pr = pr
rcpinfo.depends = sortlist(squashspaces(d.getVar('DEPENDS', True) or ""))
+ rcpinfo.bbfile = bbfile
+ rcpinfo.src_uri = src_uri
+ rcpinfo.srcrev = srcrev
+ rcpinfo.srcrev_autorev = srcrev_autorev
rcpinfo.packages = packages
write_recipehistory(rcpinfo, d)
@@ -243,6 +258,12 @@ def write_recipehistory(rcpinfo, d):
f.write("DEPENDS = %s\n" % rcpinfo.depends)
f.write("PACKAGES = %s\n" % rcpinfo.packages)
+ if rcpinfo.srcrev:
+ srcrevfile = os.path.join(pkghistdir, "latest_srcrev")
+ with open(srcrevfile, "w") as f:
+ f.write(','.join([rcpinfo.bbfile, rcpinfo.src_uri, rcpinfo.srcrev,
+ rcpinfo.srcrev_autorev]))
+
def write_pkghistory(pkginfo, d):
bb.debug(2, "Writing package history for package %s" % pkginfo.name)
OpenPOWER on IntegriCloud