Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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 5e3ce8f
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 6 deletions.
4 changes: 2 additions & 2 deletions .ci/travis/linux/docker-build-test.sh
Expand Up @@ -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})"

Expand Down Expand Up @@ -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=$?
Expand Down
2 changes: 1 addition & 1 deletion .ci/travis/macos/script.sh
Expand Up @@ -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}
Expand Down
4 changes: 2 additions & 2 deletions scripts/qgis_srs.sh
Expand Up @@ -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)
Expand All @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion scripts/sipdiff
Expand Up @@ -16,7 +16,7 @@ while getopts ":s" opt; do
;;
esac
done
shift $(expr $OPTIND - 1)
shift $(($OPTIND - 1))



Expand Down

0 comments on commit 5e3ce8f

Please sign in to comment.