From a65685c388c4400d5fc76748c1d2afa23199ed77 Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Mon, 8 Jun 2015 20:44:10 +0200 Subject: [PATCH 1/2] livebuild: Publish all build results including the metadata live-build is producing different formats and additional metadata files. --- build-recipe-livebuild | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/build-recipe-livebuild b/build-recipe-livebuild index ddbe54277..6771fe8fa 100644 --- a/build-recipe-livebuild +++ b/build-recipe-livebuild @@ -193,25 +193,42 @@ recipe_build_livebuild() { chroot $BUILD_ROOT su -c "cd $TOPDIR/$LIVEBUILD_ROOT && lb build" - root \ < /dev/null || cleanup_and_exit 1 - # Move created product to destination + # extract build result basenames + local build_results="" for i in $BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/* ; do test -f "$i" || continue case "${i##*/}" in + *.hybrid.iso) + build_results="${build_results}\n${i%%.hybrid.iso}" + ;; *.iso) - # all created files share the same name without suffix - mv ${i%%.iso}.* $BUILD_ROOT/$TOPDIR/OTHER/. - BUILD_SUCCEEDED=true + build_results="${build_results}\n${i%%.iso}" + ;; + *.img) + build_results="${build_results}\n${i%%.img}" + ;; + *.netboot.tar*) + build_results="${build_results}\n${i%%.netboot.tar*}" + ;; + *.tar*) + build_results="${build_results}\n${i%%.tar*}" ;; *) ;; esac done - # Fail the build if no ISO was created - if [ -z "$(ls $BUILD_ROOT/$TOPDIR/OTHER/*.iso)" ] ; then - echo "No ISO image found" + # Fail the build if no build results are found + if [ -z "${build_results}" ] ; then + echo "No live-build result found" cleanup_and_exit 1 fi + + # move created products (and their metadata files) to destination + for i in $(echo -e ${build_results} | sort | uniq) ; do + mv ${i}.* $BUILD_ROOT/$TOPDIR/OTHER/. + BUILD_SUCCEEDED=true + done } recipe_resultdirs_livebuild() { From 84e71abc3aff66aeae56f314752065639eb78f79 Mon Sep 17 00:00:00 2001 From: Jan Blunck Date: Tue, 9 Jun 2015 10:24:35 +0200 Subject: [PATCH 2/2] livebuild: Add -Build$RELEASE if $RELEASE is set --- build-recipe-livebuild | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/build-recipe-livebuild b/build-recipe-livebuild index 6771fe8fa..3b2721798 100644 --- a/build-recipe-livebuild +++ b/build-recipe-livebuild @@ -225,9 +225,13 @@ recipe_build_livebuild() { fi # move created products (and their metadata files) to destination - for i in $(echo -e ${build_results} | sort | uniq) ; do - mv ${i}.* $BUILD_ROOT/$TOPDIR/OTHER/. - BUILD_SUCCEEDED=true + local buildnum="${RELEASE:+-Build${RELEASE}}" + for prefix in $(echo -e ${build_results} | sort | uniq) ; do + for f in ${prefix}.* ; do + mv ${f} \ + $BUILD_ROOT/$TOPDIR/OTHER/${prefix##*/}${buildnum}${f#${prefix}} + BUILD_SUCCEEDED=true + done done }