[CONSOLIDATED,PULL,013/113] buildhistory: avoid quoting issues with the layer list for build-id

Submitted by Saul Wold on Jan. 3, 2012, 6:18 a.m. | Patch ID: 18027


Message ID f74c500a0d3979dea7393524e71ca7ec03bb5fde.1325571069.git.sgw@linux.intel.com
State Accepted
Commit f74c500a0d3979dea7393524e71ca7ec03bb5fde
Headers show

Commit Message

Saul Wold Jan. 3, 2012, 6:18 a.m.
From: Christopher Larson <kergoth@gmail.com>

Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

The layer list is multiline, and includes quotes, so including it within
quotes is problematic, particularly if the revision includes characters which
are not valid outside of a quoted string in shell. To reproduce this failure:
do a build with an scm layer not on a branch.

Signed-off-by: Christopher Larson <chris_larson@mentor.com (mailto:chris_larson@mentor.com)>
 meta/classes/buildhistory.bbclass |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

Patch hide | download patch | download mbox

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index 39f5ff6..6a08db4 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -325,7 +325,10 @@  buildhistory_get_imageinfo() {
 	# Add some configuration information
 	echo "${MACHINE}: ${IMAGE_BASENAME} configured for ${DISTRO} ${DISTRO_VERSION}" > ${BUILDHISTORY_DIR_IMAGE}/build-id
-	echo "${@buildhistory_get_layers(d)}" >> ${BUILDHISTORY_DIR_IMAGE}/build-id
+	cat >> ${BUILDHISTORY_DIR_IMAGE}/build-id <<END
 # By prepending we get in before the removal of packaging files