Skip to content
Permalink
Browse files

SC2003: expr is antiquated. Consider rewriting this using $((..)), ${…

…} or [[ ]].
  • Loading branch information
m-kuhn authored and nyalldawson committed May 31, 2018
1 parent 09f17d9 commit 5e3ce8ff6ac538bc7c857a3043afb46860768adf
Showing with 6 additions and 6 deletions.
  1. +2 −2 .ci/travis/linux/docker-build-test.sh
  2. +1 −1 .ci/travis/macos/script.sh
  3. +2 −2 scripts/qgis_srs.sh
  4. +1 −1 scripts/sipdiff
@@ -71,7 +71,7 @@ echo "travis_fold:end:cmake"
TRAVIS_TIME=120
UPLOAD_TIME=5
CURRENT_TIME=$(date +%s)
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
TIMEOUT=$((( ${TRAVIS_TIME} - ${UPLOAD_TIME} ) * 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP}))
TIMEOUT=$(( ${TIMEOUT} < 300 ? 300 : ${TIMEOUT} ))
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"

@@ -108,7 +108,7 @@ popd > /dev/null # /root/QGIS
# Run tests
###########
CURRENT_TIME=$(date +%s)
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
TIMEOUT=$((( ${TRAVIS_TIME} - ${UPLOAD_TIME}) * 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP}))
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
timeout ${TIMEOUT}s python3 /root/QGIS/.ci/travis/scripts/ctest2travis.py xvfb-run ctest -V -E "$(cat /root/QGIS/.ci/travis/linux/blacklist.txt | sed -r '/^(#.*?)?$/d' | paste -sd '|' -)" -S /root/QGIS/.ci/travis/travis.ctest --output-on-failure
rv=$?
@@ -27,7 +27,7 @@ ccache -z
#
# Travis will kill the job after approx 48 minutes, we subtract 8 minutes for
# uploading and initialization (40) and subtract the bootstrapping time from that.
TIMEOUT=$(expr 40 \* 60 - "$(date +%s)" + "$(cat /tmp/travis_timestamp)")
TIMEOUT=$((40 * 60 - $(date +%s) + $(cat /tmp/travis_timestamp)))

export CTEST_BUILD_COMMAND=/usr/local/bin/ninja
export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}
@@ -201,7 +201,7 @@ for i in $(awk 'NR>1' ${gdal_share}/pcs.csv | cut -d, -f1); do

if [ -n "$raw" ]; then

no=$(expr $no + 1)
no=$(($no + 1))
name=$(echo $raw | sed 's/^# //' | grep -o "^.\{1,\} <[[:digit:]]\{1,\}>" | sed 's/ <[[:digit:]]\{1,\}>//' | sed "s/'/''/g")
proj=$(echo $raw | grep -o "+proj=[^[:space:]]\{1,\}" | cut -d"=" -f2)
ellps=$(echo $raw | grep -o "+ellps=[^[:space:]]\{1,\}" | cut -d"=" -f2)
@@ -224,7 +224,7 @@ for i in $(awk 'NR>1' ${gdal_share}/gcs.csv | cut -d, -f1); do

if [ -n "$raw" ]; then

no=$(expr $no + 1)
no=$(($no + 1))
name=$(echo $raw | sed 's/^# //' | grep -o "^.\{1,\} <[[:digit:]]\{1,\}>" | sed 's/ <[[:digit:]]\{1,\}>//' | sed "s/'/''/g")
proj=$(echo $raw | grep -o "+proj=[^[:space:]]\{1,\}" | cut -d"=" -f2)
ellps=$(echo $raw | grep -o "+ellps=[^[:space:]]\{1,\}" | cut -d"=" -f2)
@@ -16,7 +16,7 @@ while getopts ":s" opt; do
;;
esac
done
shift $(expr $OPTIND - 1)
shift $(($OPTIND - 1))



0 comments on commit 5e3ce8f

Please sign in to comment.
You can’t perform that action at this time.