1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
|
diff --git a/src/test/regress/GNUmakefile b/src/test/regress/GNUmakefile
index 3d6a939..865351a 100644
--- a/src/test/regress/GNUmakefile
+++ b/src/test/regress/GNUmakefile
@@ -122,7 +122,8 @@ all-spi:
##
check: all
- $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT)
+ chown portage .
+ su -s /bin/sh portage -c "clientbindir=/usr/lib/postgresql-${SLOT}/bin/ PATH=\"${PATH}\" $(SHELL) ./pg_regress --temp-install --top-builddir=$(top_builddir) --temp-port=$(TEMP_PORT) --schedule=$(srcdir)/parallel_schedule --multibyte=$(MULTIBYTE) $(MAXCONNOPT)"
installcheck: all
$(SHELL) ./pg_regress --schedule=$(srcdir)/serial_schedule --multibyte=$(MULTIBYTE)
diff --git a/src/test/regress/pg_regress.sh b/src/test/regress/pg_regress.sh
index 47f2cb9..130c671 100644
--- a/src/test/regress/pg_regress.sh
+++ b/src/test/regress/pg_regress.sh
@@ -80,6 +80,8 @@ host_platform='@host_tuple@'
enable_shared='@enable_shared@'
GCC=@GCC@
+test -z "${clientbindir}" && clientbindir="${bindir}"
+
if [ "$GCC" = yes ]; then
compiler=gcc
else
@@ -409,7 +411,7 @@ then
# wait forever, however.
i=0
max=60
- until "$bindir/psql" $psql_options template1 </dev/null 2>/dev/null
+ until "$clientbindir/psql" $psql_options template1 </dev/null 2>/dev/null
do
i=`expr $i + 1`
if [ $i -ge $max ]
@@ -457,7 +459,7 @@ else # not temp-install
echo "(using postmaster on Unix socket, $port_info)"
fi
message "dropping database \"$dbname\""
- "$bindir/dropdb" $psql_options "$dbname"
+ "$clientbindir/dropdb" $psql_options "$dbname"
# errors can be ignored
fi
@@ -466,7 +468,7 @@ fi
# Set up SQL shell for the test.
# ----------
-PSQL="$bindir/psql -a -q -X $psql_options"
+PSQL="$clientbindir/psql -a -q -X $psql_options"
# ----------
@@ -497,13 +499,13 @@ fi
# ----------
message "creating database \"$dbname\""
-"$bindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
+"$clientbindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
if [ $? -ne 0 ]; then
echo "$me: createdb failed"
(exit 2); exit
fi
-"$bindir/psql" $psql_options -c "\
+"$clientbindir/psql" $psql_options -c "\
alter database \"$dbname\" set lc_messages to 'C';
alter database \"$dbname\" set lc_monetary to 'C';
alter database \"$dbname\" set lc_numeric to 'C';
@@ -519,7 +521,7 @@ fi
# ----------
message "dropping regression test user accounts"
-"$bindir/psql" $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
+"$clientbindir/psql" $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
if [ $? -eq 2 ]; then
echo "$me: could not drop user accounts"
(exit 2); exit
@@ -532,7 +534,7 @@ fi
if [ "$enable_shared" = yes ]; then
message "installing PL/pgSQL"
- "$bindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
+ "$clientbindir/createlang" -L "$pkglibdir" $psql_options plpgsql $dbname
if [ $? -ne 0 ] && [ $? -ne 2 ]; then
echo "$me: createlang failed"
(exit 2); exit
|