From f23ce0d6bd779884a45186aaca6afa8514b821b4 Mon Sep 17 00:00:00 2001 From: Attila Lendvai Date: Wed, 22 Mar 2023 09:55:12 +0100 Subject: [PATCH] build.sh adjust some syntax, make it more robust --- build.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/build.sh b/build.sh index c0ac27f..bd96a45 100755 --- a/build.sh +++ b/build.sh @@ -6,8 +6,8 @@ TARGET_ARCHITECTURE=$1 TARGET_VARIANT=$2 TARGET_DEVICE=$3 -BUILD=`dirname "$0"`"/build/" -BUILD=`readlink -f $BUILD` +BUILD="$(dirname "${0}")/build/" +BUILD="$(readlink -f "${BUILD}")" ### ### chose a release @@ -59,28 +59,28 @@ SAVE_SPACE_PACKAGES="" PREINSTALLED_PACKAGES+=${SAVE_SPACE_PACKAGES} -mkdir -pv ${BUILD} +mkdir -pv "${BUILD}" -rm -rf $IMGTEMPDIR -cp -r image-extras/common/ $IMGTEMPDIR -PER_PLATFORM_IMAGE_EXTRAS=image-extras/${TARGET_DEVICE}/ -if [ -e $PER_PLATFORM_IMAGE_EXTRAS ]; then - rsync -pr $PER_PLATFORM_IMAGE_EXTRAS $IMGTEMPDIR/ +rm -rf "${IMGTEMPDIR}" +cp -r image-extras/common/ "${IMGTEMPDIR}" +PER_PLATFORM_IMAGE_EXTRAS="image-extras/${TARGET_DEVICE}/" +if [ -e "${PER_PLATFORM_IMAGE_EXTRAS}" ]; then + rsync -pr "${PER_PLATFORM_IMAGE_EXTRAS}" "${IMGTEMPDIR}/" fi -if [ ! -e ${IMGBUILDER_DIR} ]; then - pushd ${BUILD} +if [ ! -e "${IMGBUILDER_DIR}" ]; then + pushd "${BUILD}" # --no-check-certificate if needed - wget --continue ${IMGBUILDERURL} - xz -d <${IMGBUILDER_ARCHIVE} | tar vx + wget --continue "${IMGBUILDERURL}" + xz -d <"${IMGBUILDER_ARCHIVE}" | tar vx popd fi -pushd ${IMGBUILDER_DIR} +pushd "${IMGBUILDER_DIR}" make image PROFILE=${TARGET_DEVICE} PACKAGES="${PREINSTALLED_PACKAGES}" FILES=${IMGTEMPDIR} -pushd bin/targets/${TARGET_ARCHITECTURE}/ +pushd "bin/targets/${TARGET_ARCHITECTURE}/" ln -s ../../../packages . popd