From: Thanh Ha Date: Sat, 27 May 2017 16:39:59 +0000 (-0400) Subject: Fix jjb-verify to not fail on ls call X-Git-Tag: v0.3.0~17 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=4e18e5e3a78806b47a94ce6e337366bf1893697c;p=releng%2Fglobal-jjb.git Fix jjb-verify to not fail on ls call The set -e configure fails the build when ls returns an error state. Rewrite the code such that it passes correctly and does not fail the build. Change-Id: Ib1e99dd3c8ce596610d5119b9fcdf01c626bcbdd Signed-off-by: Thanh Ha --- diff --git a/shell/jjb-verify-job.sh b/shell/jjb-verify-job.sh index cc0aa0b9..509b9533 100644 --- a/shell/jjb-verify-job.sh +++ b/shell/jjb-verify-job.sh @@ -21,11 +21,10 @@ jenkins-jobs -l DEBUG test --recursive -o archives/job-configs jjb/ pushd archives/job-configs for letter in {a..z} do - ls "$letter"* > /dev/null 2>&1 - if [[ "$?" -eq 0 ]] + if [[ $(ls "$letter"* > /dev/null 2>&1) -eq 0 ]] then mkdir "$letter" - find . -type f -maxdepth 1 -name "$letter*" -exec mv {} "$letter" \; + find . -maxdepth 1 -type f -name "$letter*" -exec mv {} "$letter" \; fi done popd