Openembedded Core Discussions
 help / color / mirror / Atom feed
From: Martin Jansa <martin.jansa@gmail.com>
To: openembedded-core@lists.openembedded.org
Subject: [PATCH] buildhistory: rename build-id to build-id.txt and add more info
Date: Fri, 25 Jul 2014 15:15:38 +0200	[thread overview]
Message-ID: <1406294138-31362-1-git-send-email-Martin.Jansa@gmail.com> (raw)

* use .txt extension like other reports (e.g. image-info.txt) it's
  also useful when looking at the file from web server which doesn't
  have text/plain as default content-type
* include whole BUILDCFG_HEADER/BUILDCFG_FUNCS instead of just layer
  info
* this makes it easier for distro to include more fields without the
  need to modify buildhistory.bbclass
* currently it adds following fields:
  Build Configuration:
  BB_VERSION        = "1.23.1"
  BUILD_SYS         = "x86_64-linux"
  NATIVELSBSTRING   = "Gentoo-2.2"
  TARGET_SYS        = "x86_64-oe-linux"
  MACHINE           = "qemux86-64"
  DISTRO            = "shr"
  DISTRO_VERSION    = "2013.07-next-20140725"
  TUNE_FEATURES     = "m64 core2"
  TARGET_FPU        = ""

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
---
 meta/classes/buildhistory.bbclass | 26 ++++++++++++++++++--------
 1 file changed, 18 insertions(+), 8 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 20382ce..479e460 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -461,10 +461,10 @@ END
 	echo "IMAGESIZE = $imagesize" >> ${BUILDHISTORY_DIR_IMAGE}/image-info.txt
 
 	# Add some configuration information
-	echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id
+	echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id.txt
 
-	cat >> ${BUILDHISTORY_DIR_IMAGE}/build-id <<END
-${@buildhistory_get_layers(d)}
+	cat >> ${BUILDHISTORY_DIR_IMAGE}/build-id.txt <<END
+${@buildhistory_get_build_id(d)}
 END
 }
 
@@ -498,11 +498,21 @@ POPULATE_SDK_POST_HOST_COMMAND_append = " buildhistory_list_installed_sdk_host ;
 
 SDK_POSTPROCESS_COMMAND += "buildhistory_get_sdkinfo ; "
 
-def buildhistory_get_layers(d):
-    if d.getVar('BB_WORKERCONTEXT', True) != '1':
-        return ""
-    layertext = "Configured metadata layers:\n%s\n" % '\n'.join(get_layers_branch_rev(d))
-    return layertext
+def buildhistory_get_build_id(d):
+    localdata = bb.data.createCopy(d)
+    bb.data.update_data(localdata)
+    statuslines = []
+    for func in oe.data.typed_value('BUILDCFG_FUNCS', localdata):
+        g = globals()
+        if func not in g:
+            bb.warn("Build configuration function '%s' does not exist" % func)
+        else:
+            flines = g[func](localdata)
+            if flines:
+                statuslines.extend(flines)
+
+    statusheader = d.getVar('BUILDCFG_HEADER', True)
+    return('\n%s\n%s\n' % (statusheader, '\n'.join(statuslines)))
 
 def buildhistory_get_metadata_revs(d):
     # We want an easily machine-readable format here, so get_layers_branch_rev isn't quite what we want
-- 
2.0.2



             reply	other threads:[~2014-07-25 13:15 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 13:15 Martin Jansa [this message]
2014-08-16 18:21 ` [PATCH] buildhistory: rename build-id to build-id.txt and add more info Martin Jansa
2014-08-18 10:54   ` Paul Eggleton
2014-08-24 16:19     ` Martin Jansa

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=1406294138-31362-1-git-send-email-Martin.Jansa@gmail.com \
    --to=martin.jansa@gmail.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