From 6273fc478b9c95c4ae8d42c9021f9428b1d43811 Mon Sep 17 00:00:00 2001 From: David Spickett Date: Thu, 23 Apr 2020 11:10:08 +0100 Subject: Shellcheck fixes round 3 Now using the version that's present in the bionic images. Meaning we have more warnings but can also set the minimum level to ignore a lot of them. Fix the check for whether shellcheck supports --severity. (we have pipefail on, but we expect shellcheck to fail in this case) Change-Id: I296b8554591b7d327c75393e3924184abc6512b7 --- jenkins.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'jenkins.sh') diff --git a/jenkins.sh b/jenkins.sh index 4be4bd04..33f103af 100755 --- a/jenkins.sh +++ b/jenkins.sh @@ -239,7 +239,7 @@ user_snapshots="${user_workspace}/snapshots" arch="$(uname -m)" -if [ x"$logserver" = x"" -a x"$logname" != x"" ]; then +if [ x"$logserver" = x"" ] && [ x"$logname" != x"" ]; then echo "ERROR: \$logname is not provided, but \$logserver is set to $logserver" exit 1 fi @@ -418,12 +418,13 @@ $CONFIG_SHELL ${abe_dir}/configure --with-local-snapshots=${user_snapshots} --wi # load commonly used varibles set by configure if test -e "${PWD}/host.conf"; then + # shellcheck disable=SC1090 . "${PWD}/host.conf" fi # We used to delete *.sum files, but this should not be necessary. This # check is transitional, and will be removed later. -if [ ! -z "$(find ${user_workspace} -name \*.sum)" ]; then +if [ -n "$(find ${user_workspace} -name \*.sum)" ]; then echo "Found *.sum files, but workspace should be empty!" exit 1 fi @@ -527,14 +528,14 @@ fi if test x"${logserver}" != x"" ; then if test x"${tarsrc}" = xtrue -a x"${release}" != x; then allfiles="$(ls ${user_snapshots}/*${release}*.xz)" - srcfiles="$(echo ${allfiles} | egrep -v "arm|aarch")" + srcfiles="$(echo ${allfiles} | grep -E -v "arm|aarch")" scp $logopts ${srcfiles} ${logserver}:/home/abe/var/snapshots/ || status=1 rm -f ${srcfiles} || status=1 fi if test x"${tarbin}" = xtrue -a x"${release}" != x; then allfiles="$(ls ${user_snapshots}/*${release}*.xz)" - binfiles="$(echo ${allfiles} | egrep "arm|aarch")" + binfiles="$(echo ${allfiles} | grep -E "arm|aarch")" scp $logopts ${binfiles} ${logserver}:/work/space/binaries/ || status=1 rm -f ${binfiles} || status=1 fi -- cgit v1.2.3