Skip to contentSkip to conversation

buildhistory: avoid quoting issues with the layer list for build-id

PATCH Applied Christopher Larson 3 participants 3 messages Dec 23, 2011 – Jan 3, 2012

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 buildhistory: avoid quoting issues with the layer list for build-id

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 <[email protected] (mailto:[email protected])>

---
meta/classes/buildhistory.bbclass | 5 ++++-

1 files changed, 4 insertions(+), 1 deletions(-)
meta/classes/buildhistory.bbclass +0 -0
index 39f5ff6..6a08db4 100644
@@ -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
+${@buildhistory_get_layers(d)}
+END
}

# By prepending we get in before the removal of packaging files

Signature · 1 line
1.7.8
Acked-by on v1 1/1
#1 lore raw
Quoted 25 lines · On Friday 23 December 2011 09:23:57 Christopher Larson wrote:

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.

(mailto:[email protected])> ---
meta/classes/buildhistory.bbclass | 5 ++++-

1 files changed, 4 insertions(+), 1 deletions(-)
(quoted diff) +0 -0

b/meta/classes/buildhistory.bbclass index 39f5ff6..6a08db4 100644

meta/classes/buildhistory.bbclass +0 -0
@@ -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 +${@buildhistory_get_layers(d)}
+END
}

Quoted 1 line

# By prepending we get in before the removal of packaging files

Hmm, hadn't thought of this. Thanks!

Cheers,
Paul

Signature · 2 lines
Paul Eggleton
Intel Open Source Technology Centre
Applied
#2 lore raw
In reply to Christopher Larson
Quoted 34 lines · Christopher Larson

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.

<mailto:[email protected]>>
---
meta/classes/buildhistory.bbclass | 5 ++++-

1 files changed, 4 insertions(+), 1 deletions(-)
meta/classes/buildhistory.bbclass +0 -0
index 39f5ff6..6a08db4 100644
@@ -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

meta/classes/buildhistory.bbclass +4 -0
+
+ cat >> ${BUILDHISTORY_DIR_IMAGE}/build-id <<END
+${@buildhistory_get_layers(d)}
+END

}
# By prepending we get in before the removal of packaging files --
1.7.8

Quoted 4 lines

_______________________________________________
Openembedded-core mailing list
[email protected]
http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Merged into OE-Core

Thanks
Sau!