From: garciadeblas Date: Fri, 1 Sep 2017 09:43:23 +0000 (+0200) Subject: Fix string comparison to work with sh X-Git-Tag: v3.0.0rc~14 X-Git-Url: https://osm.etsi.org/gitweb/?p=osm%2Fdevops.git;a=commitdiff_plain;h=c7f35240b0fddd27e15e4acb0e79ac74cba090eb Fix string comparison to work with sh Change-Id: I8f85afcde0c953ba175410257485a7a68f892cff Signed-off-by: garciadeblas --- diff --git a/tools/license_scan.sh b/tools/license_scan.sh index 32956003..47106e0e 100755 --- a/tools/license_scan.sh +++ b/tools/license_scan.sh @@ -33,7 +33,8 @@ for file in $(git diff --name-only origin/$GERRIT_BRANCH); do if [ -f $file ]; then if [ -s $file ]; then license=$(wget -qO - --post-file $file https://osm.etsi.org/fossology/?mod=agent_nomos_once |sed "s/^[ \t]*//;s/[ \t]*$//") - if [[ $license =~ $RE ]]; then + result=$(echo $license | grep "$RE") + if [ -n "$result" ]; then # possibly we have exceeded the post rate sleep 10 license=$(wget -qO - --post-file $file https://osm.etsi.org/fossology/?mod=agent_nomos_once |sed "s/^[ \t]*//;s/[ \t]*$//")