Skip to content

Commit 5e3ce8f

Browse files
m-kuhnnyalldawson
authored andcommittedMay 31, 2018
SC2003: expr is antiquated. Consider rewriting this using $((..)), ${} or [[ ]].
1 parent 09f17d9 commit 5e3ce8f

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed
 

‎.ci/travis/linux/docker-build-test.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ echo "travis_fold:end:cmake"
7171
TRAVIS_TIME=120
7272
UPLOAD_TIME=5
7373
CURRENT_TIME=$(date +%s)
74-
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
74+
TIMEOUT=$((( ${TRAVIS_TIME} - ${UPLOAD_TIME} ) * 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP}))
7575
TIMEOUT=$(( ${TIMEOUT} < 300 ? 300 : ${TIMEOUT} ))
7676
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
7777

@@ -108,7 +108,7 @@ popd > /dev/null # /root/QGIS
108108
# Run tests
109109
###########
110110
CURRENT_TIME=$(date +%s)
111-
TIMEOUT=$(expr \( ${TRAVIS_TIME} - ${UPLOAD_TIME} \) \* 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP})
111+
TIMEOUT=$((( ${TRAVIS_TIME} - ${UPLOAD_TIME}) * 60 - ${CURRENT_TIME} + ${TRAVIS_TIMESTAMP}))
112112
echo "Timeout: ${TIMEOUT}s (started at ${TRAVIS_TIMESTAMP}, current: ${CURRENT_TIME})"
113113
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
114114
rv=$?

‎.ci/travis/macos/script.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ ccache -z
2727
#
2828
# Travis will kill the job after approx 48 minutes, we subtract 8 minutes for
2929
# uploading and initialization (40) and subtract the bootstrapping time from that.
30-
TIMEOUT=$(expr 40 \* 60 - "$(date +%s)" + "$(cat /tmp/travis_timestamp)")
30+
TIMEOUT=$((40 * 60 - $(date +%s) + $(cat /tmp/travis_timestamp)))
3131

3232
export CTEST_BUILD_COMMAND=/usr/local/bin/ninja
3333
export CTEST_BUILD_DIR=${TRAVIS_BUILD_DIR}

‎scripts/qgis_srs.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@ for i in $(awk 'NR>1' ${gdal_share}/pcs.csv | cut -d, -f1); do
201201

202202
if [ -n "$raw" ]; then
203203

204-
no=$(expr $no + 1)
204+
no=$(($no + 1))
205205
name=$(echo $raw | sed 's/^# //' | grep -o "^.\{1,\} <[[:digit:]]\{1,\}>" | sed 's/ <[[:digit:]]\{1,\}>//' | sed "s/'/''/g")
206206
proj=$(echo $raw | grep -o "+proj=[^[:space:]]\{1,\}" | cut -d"=" -f2)
207207
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
224224

225225
if [ -n "$raw" ]; then
226226

227-
no=$(expr $no + 1)
227+
no=$(($no + 1))
228228
name=$(echo $raw | sed 's/^# //' | grep -o "^.\{1,\} <[[:digit:]]\{1,\}>" | sed 's/ <[[:digit:]]\{1,\}>//' | sed "s/'/''/g")
229229
proj=$(echo $raw | grep -o "+proj=[^[:space:]]\{1,\}" | cut -d"=" -f2)
230230
ellps=$(echo $raw | grep -o "+ellps=[^[:space:]]\{1,\}" | cut -d"=" -f2)

‎scripts/sipdiff

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ while getopts ":s" opt; do
1616
;;
1717
esac
1818
done
19-
shift $(expr $OPTIND - 1)
19+
shift $(($OPTIND - 1))
2020

2121

2222

0 commit comments

Comments
 (0)
Please sign in to comment.