summaryrefslogtreecommitdiff
blob: 28e29253dacb7fa95491c2ae226613096e3e3da3 (plain)
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
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
--- src/test/regress/pg_regress.sh	2006-08-01 10:57:17.000000000 +0200
+++ src/test/regress/pg_regress.sh	2006-08-04 00:14:39.000000000 +0200
@@ -81,8 +81,8 @@
 # Initialize default settings
 # ----------
 
-: ${inputdir=.}
-: ${outputdir=.}
+: ${inputdir=PORTAGETEMPDIRPG}
+: ${outputdir=PORTAGETEMPDIRPG}
 
 libdir='@libdir@'
 bindir='@bindir@'
@@ -410,7 +410,8 @@
     message "initializing database system"
     [ "$debug" = yes ] && initdb_options="--debug"
     [ "$nolocale" = yes ] && initdb_options="$initdb_options --no-locale"
-    "$bindir/initdb" -D "$PGDATA" -L "$datadir" --noclean $initdb_options >"$LOGDIR/initdb.log" 2>&1
+    chown portage "${datadir}" "${temp_install}" "${inputdir}/testtablespace"
+    su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/initdb -D '$PGDATA' -L '$datadir' --noclean $initdb_options" >"$LOGDIR/initdb.log" 2>&1
 
     if [ $? -ne 0 ]
     then
@@ -433,7 +434,7 @@
     else
         postmaster_options="$postmaster_options -c listen_addresses="
     fi
-    "$bindir/postmaster" -D "$PGDATA" -F $postmaster_options >"$LOGDIR/postmaster.log" 2>&1 &
+    su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/postmaster -D '$PGDATA' -F $postmaster_options" >"$LOGDIR/postmaster.log" 2>&1 &
     postmaster_pid=$!
 
     # Wait till postmaster is able to accept connections (normally only
@@ -441,7 +442,7 @@
     # wait forever, however.
     i=0
     max=60
-    until "$bindir/psql" -X $psql_options postgres </dev/null 2>/dev/null
+    until su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/psql -X $psql_options postgres </dev/null 2>/dev/null"
     do
         i=`expr $i + 1`
         if [ $i -ge $max ]
@@ -498,7 +499,7 @@
     fi
 
     message "dropping database \"$dbname\""
-    "$bindir/dropdb" $psql_options "$dbname"
+    su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='ISO, MDY' $bindir/dropdb $psql_options '$dbname'"
     # errors can be ignored
 fi
 
@@ -538,17 +539,17 @@
 # ----------
 
 message "creating database \"$dbname\""
-"$bindir/createdb" $encoding_opt $psql_options --template template0 "$dbname"
+su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/createdb $encoding_opt $psql_options --template template0 '$dbname'"
 if [ $? -ne 0 ]; then
     echo "$me: createdb failed"
     (exit 2); exit
 fi
 
-"$bindir/psql" -q -X $psql_options -c "\
+su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/psql -q -X $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';
-alter database \"$dbname\" set lc_time to 'C';" "$dbname"
+alter database \"$dbname\" set lc_time to 'C';\" '$dbname'"
 if [ $? -ne 0 ]; then
     echo "$me: could not set database default locales"
     (exit 2); exit
@@ -560,7 +561,7 @@
 # ----------
 
 message "dropping regression test user accounts"
-"$bindir/psql" -q -X $psql_options -c 'DROP GROUP regressgroup1; DROP GROUP regressgroup2; DROP USER regressuser1, regressuser2, regressuser3, regressuser4;' $dbname 2>/dev/null
+su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/psql -q -X $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
@@ -575,7 +576,7 @@
     for lang in xyzzy $load_langs ; do    
         if [ "$lang" != "xyzzy" ]; then
             message "installing $lang"
-            "$bindir/createlang" $psql_options $lang $dbname
+            su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/createlang $psql_options $lang '$dbname'"
             if [ $? -ne 0 ] && [ $? -ne 2 ]; then
                 echo "$me: createlang $lang failed"
                 (exit 2); exit
@@ -635,7 +636,7 @@
         # Run a single test
         formatted=`echo $1 | awk '{printf "%-20.20s", $1;}'`
         $ECHO_N "test $formatted ... $ECHO_C"
-        ( $PSQL -d "$dbname" <"$inputdir/sql/$1.sql" >"$outputdir/results/$1.out" 2>&1 )&
+        ( su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' ${PSQL} -d '${dbname}' < '${inputdir}/sql/${1}.sql' > '${outputdir}/results/${1}.out' 2>&1" )&
         wait
     else
         # Start a parallel group
@@ -646,7 +647,7 @@
         fi
         for name do
             ( 
-              $PSQL -d "$dbname" <"$inputdir/sql/$name.sql" >"$outputdir/results/$name.out" 2>&1
+              su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' ${PSQL} -d '${dbname}' < '${inputdir}/sql/${name}.sql' > '${outputdir}/results/${name}.out' 2>&1"
               $ECHO_N " $name$ECHO_C"
             ) &
             if [ $maxconnections -gt 0 ] ; then
@@ -740,7 +741,7 @@
 
 if [ -n "$postmaster_pid" ]; then
     message "shutting down postmaster"
-    "$bindir/pg_ctl" -s -D "$PGDATA" stop
+    su -s /bin/sh -l portage -c "PGTZ='PST8PDT' PGDATESTYLE='Postgres, MDY' $bindir/pg_ctl -s -D '$PGDATA' stop"
     wait "$postmaster_pid"
     unset postmaster_pid
 fi