summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'dev-db/postgresql/files/postgresql-8.1.10-regress_su.patch')
-rw-r--r--dev-db/postgresql/files/postgresql-8.1.10-regress_su.patch116
1 files changed, 116 insertions, 0 deletions
diff --git a/dev-db/postgresql/files/postgresql-8.1.10-regress_su.patch b/dev-db/postgresql/files/postgresql-8.1.10-regress_su.patch
new file mode 100644
index 0000000..28e2925
--- /dev/null
+++ b/dev-db/postgresql/files/postgresql-8.1.10-regress_su.patch
@@ -0,0 +1,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