History

Fix bashims in configure and gcctestsuite.sh.

configure and gcctestsuite.sh shell scripts contains bashisms although being bourne shell script. This patch fixes the following bashisms: * Use of $RANDOM variable (replaced by reading in /dev/urandom) * Use == in tests instead of just = * Use $[] for arithmetic computation istead of $(())

Thomas Preud'homme committed 16 years ago

Commit dc265fe1 parent a867f422 files · +19 −9Browse files

Unified · Split

2 files
  1. configure +15 −5
  2. tests/gcctestsuite.sh +4 −4
configure+15−5
@@ -11,11 +11,21 @@ else · 10 unmodified lines
1111 TMPDIR1="/tmp"
1212 fi
1313
14−TMPC="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.c"
15−TMPO="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.o"
16−TMPE="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}"
17−TMPS="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.S"
18−TMPH="${TMPDIR1}/tcc-conf-${RANDOM}-$$-${RANDOM}.h"
14+RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
15+RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
16+TMPC="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.c"
17+RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
18+RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
19+TMPO="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.o"
20+RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
21+RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
22+TMPE="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}"
23+RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
24+RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
25+TMPS="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.S"
26+RDM1="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
27+RDM2="$(dd if=/dev/urandom count=1 2> /dev/null | cksum | cut -f1 -d" " )"
28+TMPH="${TMPDIR1}/tcc-conf-${RDM1}-$$-${RDM2}.h"
1929
2030 # default parameters
2131 build_cross="no"
tests/gcctestsuite.sh+4−4
@@ -8,11 +8,11 @@ nb_failed="0" · 7 unmodified lines
88 for src in $TESTSUITE_PATH/compile/*.c ; do
99 echo $TCC -o /tmp/test.o -c $src
1010 $TCC -o /tmp/test.o -c $src >> tcc.log 2>&1
11− if [ "$?" == "0" ] ; then
11+ if [ "$?" = "0" ] ; then
1212 result="PASS"
1313 else
1414 result="FAIL"
15− nb_failed=$[ $nb_failed + 1 ]
15+ nb_failed=$(( $nb_failed + 1 ))
1616 fi
1717 echo "$result: $src" >> tcc.sum
1818 done
@@ -20,11 +20,11 @@ done · 1 unmodified line
2020 for src in $TESTSUITE_PATH/execute/*.c ; do
2121 echo $TCC $src
2222 $TCC $src >> tcc.log 2>&1
23− if [ "$?" == "0" ] ; then
23+ if [ "$?" = "0" ] ; then
2424 result="PASS"
2525 else
2626 result="FAIL"
27− nb_failed=$[ $nb_failed + 1 ]
27+ nb_failed=$(( $nb_failed + 1 ))
2828 fi
2929 echo "$result: $src" >> tcc.sum
3030 done

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t