File: regresscheck

package info (click to toggle)
pglogical 2.4.6-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,300 kB
  • sloc: ansic: 39,268; sql: 4,466; perl: 693; makefile: 210; sh: 78
file content (44 lines) | stat: -rwxr-xr-x 942 bytes parent folder | download
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
#!/bin/sh

set -e

SRCDIR=$(pwd)

# Make sure to have a writable copy of the source
WORKDIR=$(mktemp -d -t regresscheck.XXXXXX)
cleanup () {
	cp -a $WORKDIR/regression_output $SRCDIR || :
	rm -rf $WORKDIR
}
trap cleanup 0 HUP INT QUIT ILL ABRT PIPE TERM
cp -r $SRCDIR/* $WORKDIR/
cd $WORKDIR

# If executed as root become nobody
if [ $(id -u) -eq 0 ]
then
	chown nobody -R $WORKDIR/
	SU='su nobody -p -c'
else
	SU='bash -c'
fi

FAILED=
# Execute make regresscheck for all the supported versions
for v in $(pg_buildext installed-versions); do
	echo "### PostgreSQL $v regresscheck ###"
	VERSION_PATH="/usr/lib/postgresql/$v/bin:$PATH"
	if ! $SU "PATH=$VERSION_PATH make regresscheck PG_CONFIG=/usr/lib/postgresql/$v/bin/pg_config USE_PGXS=1"; then
		set +e
		cat regression_output/regression.diffs
		for log in regression_output/log/*.log; do
			echo "*** $log ***"
			cat $log
		done
		FAILED=1
	fi
done

if [ -n "$FAILED" ]; then
	exit 1
fi