From 12d4f9ee95b0cd0acd72b16b73891bb558d61b01 Mon Sep 17 00:00:00 2001 From: niusmallnan Date: Thu, 8 Nov 2018 16:10:23 +0800 Subject: [PATCH] Fix script format --- scripts/build-common | 6 +++--- scripts/build-kernel | 22 +++++++++++----------- scripts/ci | 4 ++-- scripts/extract | 4 ++-- scripts/release | 4 ++-- scripts/test-firmware | 30 +++++++++++++++--------------- 6 files changed, 35 insertions(+), 35 deletions(-) diff --git a/scripts/build-common b/scripts/build-common index 44a4d11..9945c75 100644 --- a/scripts/build-common +++ b/scripts/build-common @@ -2,9 +2,9 @@ set -e if [[ "$KERNEL_TAG" == "" ]]; then - echo "ERROR: Please set the KERNEL_TAG (the mainline KERNEL version is also the git tag) you're building" - echo " e.g., KERNEL_TAG=4.9.10 make release" - exit 1 + echo "ERROR: Please set the KERNEL_TAG (the mainline KERNEL version is also the git tag) you're building" + echo " e.g., KERNEL_TAG=4.9.10 make release" + exit 1 fi : ${ARTIFACTS:=$(pwd)/assets} diff --git a/scripts/build-kernel b/scripts/build-kernel index 275e95e..9834bf9 100755 --- a/scripts/build-kernel +++ b/scripts/build-kernel @@ -15,16 +15,16 @@ MODULE_LIST=$(readlink -f modules.list) MODULE_EXTRA_LIST=$(readlink -f modules-extra.list) if [ -e "/source/dist/kernel/linux-${KERNEL_VERSION}-x86.tar.gz" ]; then - echo "skipping kernel build - found linux-${KERNEL_VERSION}-rancher-x86.tar.gz in ./dist/kernel/" + echo "skipping kernel build - found linux-${KERNEL_VERSION}-rancher-x86.tar.gz in ./dist/kernel/" else - cd ${BUILD}/${DIR} - make oldconfig - KVER=$(make kernelrelease) - if [ -e "linux-${KERNEL_VERSION}-x86.tar" ] \ - && [ "$KVER" == "$KERNEL_VERSION" ]; then - echo "Skipping kernel build, found linux-${KERNEL_VERSION}-x86.tar in $(pwd)" - else - echo "building $KVER" - make -j$(nproc) tar-pkg - fi + cd ${BUILD}/${DIR} + make oldconfig + KVER=$(make kernelrelease) + if [ -e "linux-${KERNEL_VERSION}-x86.tar" ] \ + && [ "$KVER" == "$KERNEL_VERSION" ]; then + echo "Skipping kernel build, found linux-${KERNEL_VERSION}-x86.tar in $(pwd)" + else + echo "building $KVER" + make -j$(nproc) tar-pkg + fi fi diff --git a/scripts/ci b/scripts/ci index c1b2ca7..477616f 100755 --- a/scripts/ci +++ b/scripts/ci @@ -6,8 +6,8 @@ cd $(dirname $0)/.. ./scripts/test-firmware if ! ./scripts/download; then - echo "blah" - exit 1 + echo "blah" + exit 1 fi ./scripts/extract run-parts -v ./scripts/hooks diff --git a/scripts/extract b/scripts/extract index 605c44a..860eddd 100755 --- a/scripts/extract +++ b/scripts/extract @@ -28,8 +28,8 @@ pushd . cd ${DIR} echo "are there patches in ${PATCHES}" for p in ${PATCHES}/*.patch; do - echo "patching $p" - patch -p1 -i $p + echo "patching $p" + patch -p1 -i $p done popd diff --git a/scripts/release b/scripts/release index 7359435..e036a3a 100755 --- a/scripts/release +++ b/scripts/release @@ -3,8 +3,8 @@ cd $(dirname $0)/.. if ! ./scripts/ci; then - echo "build failure see release.log" - exit 1 + echo "build failure see release.log" + exit 1 fi echo diff --git a/scripts/test-firmware b/scripts/test-firmware index e34aab4..8b95791 100755 --- a/scripts/test-firmware +++ b/scripts/test-firmware @@ -13,24 +13,24 @@ echo "FIRMWARE test: $FIRMWARE" cd linux-firmware for i in $(<$FIRMWARE); do - if [ -e $i ]; then - glob=$(echo $i | sed 's/^\(.*\)-\([^-]*\)\.\([^.]*\)/\1-*.\3/') - #echo Found $i, trying $glob - latest=$(ls $glob | xargs -n1 -I{} -- git log -1 --format="%ai {}" {} | sort | tail -n1 | cut -d " " -f4) - if [ "$latest" != "$i" ]; then - echo "ERROR: Firmware $i in $FIRMWARE is not the latest - update to $latest" - STOP="1" - echo $latest >> new-firmware - else - echo $i >> new-firmware - fi + if [ -e $i ]; then + glob=$(echo $i | sed 's/^\(.*\)-\([^-]*\)\.\([^.]*\)/\1-*.\3/') + #echo Found $i, trying $glob + latest=$(ls $glob | xargs -n1 -I{} -- git log -1 --format="%ai {}" {} | sort | tail -n1 | cut -d " " -f4) + if [ "$latest" != "$i" ]; then + echo "ERROR: Firmware $i in $FIRMWARE is not the latest - update to $latest" + STOP="1" + echo $latest >> new-firmware else - echo WARNING: Firmware listed in $FIRMWARE Not found $i + echo $i >> new-firmware fi + else + echo WARNING: Firmware listed in $FIRMWARE Not found $i + fi done if [ "$STOP" != "" ]; then - echo "Update the $FIRMWARE file:" - cat new-firmware - exit 1 + echo "Update the $FIRMWARE file:" + cat new-firmware + exit 1 fi