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

login
register
mail settings
Submitter Christopher Larson
Date Dec. 23, 2011, 4:23 p.m.
Message ID <3443259C5BCC4C21B2D92CD4C4B9AC73@gmail.com>
Download mbox | patch
Permalink /patch/17579/
State New
Headers show

Comments

Christopher Larson - Dec. 23, 2011, 4:23 p.m.
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(-)
Paul Eggleton - Dec. 23, 2011, 4:42 p.m.
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.
> 
> 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(-)
> 
> 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
> +${@buildhistory_get_layers(d)}
> +END
> }
> 
> # By prepending we get in before the removal of packaging files

Hmm, hadn't thought of this. Thanks!

Acked-by: Paul Eggleton <paul.eggleton@linux.intel.com>

Cheers,
Paul
Saul Wold - Jan. 3, 2012, 9:18 p.m.
On 12/23/2011 08:23 AM, 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.
>
> 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(-)
>
> 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
> +${@buildhistory_get_layers(d)}
> +END
> }
> # By prepending we get in before the removal of packaging files
> --
> 1.7.8
>
>
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.linuxtogo.org/cgi-bin/mailman/listinfo/openembedded-core

Merged into OE-Core

Thanks
	Sau!

Patch

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
+${@buildhistory_get_layers(d)}
+END
}

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