Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitae8a2c3

Browse files
committed
Make the world safe for QNX's busted shell ...
1 parent69b323f commitae8a2c3

File tree

2 files changed

+37
-18
lines changed

2 files changed

+37
-18
lines changed

‎src/test/regress/regress.sh

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/sh
2-
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.50 2000/05/16 02:14:15 tgl Exp $
2+
# $Header: /cvsroot/pgsql/src/test/regress/Attic/regress.sh,v 1.51 2000/05/24 22:32:58 tgl Exp $
33
#
44
if [$#-eq 0 ];then
55
echo"Syntax:$0 <hostname> [extra-tests]"
@@ -41,17 +41,27 @@ FRONTEND="psql $HOSTLOC -a -q -X"
4141
#testname/hostnamepattern=substitutefile
4242
# where the hostnamepattern is evaluated per the rules of expr(1) --- namely,
4343
# it is a standard regular expression with an implicit ^ at the start.
44+
#
45+
# The tempfile hackery is needed because some shells will run the loop
46+
# inside a subshell, whereupon shell variables set therein aren't seen
47+
# outside the loop :-(
4448
# ----------
45-
SUBSTLIST=""
46-
RESULTMAP=`catresultmap`
47-
forLINEin$RESULTMAP
49+
TMPFILE="matches.$$"
50+
cat/dev/null>$TMPFILE
51+
whileread LINE
4852
do
4953
HOSTPAT=`expr"$LINE":'.*/\(.*\)='`
5054
if [`expr"$hostname":"$HOSTPAT"`-ne 0 ]
5155
then
52-
SUBSTLIST="$SUBSTLIST$LINE"
56+
# remove hostnamepattern from line so that there are no shell
57+
# wildcards in SUBSTLIST; else later 'for' could expand them!
58+
TESTNAME=`expr"$LINE":'\(.*\)/'`
59+
SUBST=`echo"$LINE"| sed's/^.*=//'`
60+
echo"$TESTNAME=$SUBST">>$TMPFILE
5361
fi
54-
done
62+
done<resultmap
63+
SUBSTLIST=`cat$TMPFILE`
64+
rm -f$TMPFILE
5565

5666
if [-d ./obj ];then
5767
cd ./obj
@@ -97,7 +107,7 @@ fi
97107
fi
98108

99109
echo"=============== running regression queries... ================="
100-
echo""> regression.diffs
110+
cat /dev/null> regression.diffs
101111

102112
if ["x$hostname"="xi386-pc-qnx" ];then
103113
DIFFOPT="-b"
@@ -123,7 +133,7 @@ do
123133
EXPECTED="expected/${tst}.out"
124134
forLINEin$SUBSTLIST
125135
do
126-
if [`expr"$LINE":"$tst/"`-ne 0 ]
136+
if [`expr"$LINE":"$tst="`-ne 0 ]
127137
then
128138
SUBST=`echo"$LINE"| sed's/^.*=//'`
129139
EXPECTED="expected/${SUBST}.out"

‎src/test/regress/run_check.sh

Lines changed: 19 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/sh
22
#
3-
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.18 2000/05/18 16:11:39 momjian Exp $
3+
# $Header: /cvsroot/pgsql/src/test/regress/Attic/run_check.sh,v 1.19 2000/05/24 22:32:59 tgl Exp $
44

55
# ----------
66
# Check call syntax
@@ -104,18 +104,27 @@ FRONTEND="$BINDIR/psql $HOSTLOC -a -q -X"
104104
#testname/hostnamepattern=substitutefile
105105
# where the hostnamepattern is evaluated per the rules of expr(1) --- namely,
106106
# it is a standard regular expression with an implicit ^ at the start.
107+
#
108+
# The tempfile hackery is needed because some shells will run the loop
109+
# inside a subshell, whereupon shell variables set therein aren't seen
110+
# outside the loop :-(
107111
# ----------
108-
SUBSTLIST=""
109-
exec4<resultmap
110-
whileread LINE<&4
112+
TMPFILE="matches.$$"
113+
cat /dev/null>$TMPFILE
114+
whileread LINE
111115
do
112116
HOSTPAT=`expr"$LINE":'.*/\(.*\)='`
113117
if [`expr"$hostname":"$HOSTPAT"`-ne 0 ]
114118
then
115-
SUBSTLIST="$SUBSTLIST$LINE"
119+
# remove hostnamepattern from line so that there are no shell
120+
# wildcards in SUBSTLIST; else later 'for' could expand them!
121+
TESTNAME=`expr"$LINE":'\(.*\)/'`
122+
SUBST=`echo"$LINE"| sed's/^.*=//'`
123+
echo"$TESTNAME=$SUBST">>$TMPFILE
116124
fi
117-
done
118-
exec4<&-
125+
done<resultmap
126+
SUBSTLIST=`cat$TMPFILE`
127+
rm -f$TMPFILE
119128

120129
# ----------
121130
# Catch SIGINT and SIGTERM to shutdown the postmaster
@@ -258,8 +267,8 @@ fi
258267
# Run the regression tests specified in the ./sql/run_check.tests file
259268
# ----------
260269
echo"=============== Running regression queries... ================"
261-
echo""> regression.diffs
262-
echo""> regress.out
270+
cat /dev/null> regression.diffs
271+
cat /dev/null> regress.out
263272

264273
if ["x$hostname"="xi386-pc-qnx" ];then
265274
DIFFOPT="-b"
@@ -439,7 +448,7 @@ lno=0
439448
EXPECTED="expected/${name}.out"
440449
forLINEin$SUBSTLIST
441450
do
442-
if [`expr"$LINE":"$name/"`-ne 0 ]
451+
if [`expr"$LINE":"$name="`-ne 0 ]
443452
then
444453
SUBST=`echo"$LINE"| sed's/^.*=//'`
445454
EXPECTED="expected/${SUBST}.out"

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp