-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmulti.sh
executable file
·55 lines (46 loc) · 1.44 KB
/
multi.sh
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
#!/bin/bash
# set -eu
# Run a make target against all versions listed in .versions.
target="$1"
function usage() {
echo "USAGE: multi.sh <target>"
echo " Runs a makefile target against all Postgres installations listed in .versions."
echo " <target> should be install or installcheck."
exit 1
}
if [ -z "$target" ]; then
usage
fi
if [ ! -e ".versions" ]; then
echo "No .versions file found. See .versions.sample for details"
exit 1
fi
while IFS= read -r line; do
version=$(echo "$line" | cut -d, -f1)
port=$(echo "$line" | cut -d, -f2)
echo "================================"
echo "============= ${version} ==============="
echo "================================"
# Make sure we use the appropriate pg_config:
# TODO: Support some other way of finding the bin for each version.
# On a Mac with homebrew we want something like /usr/local/Cellar/[email protected]/9.3.25/bin.
export PATH="/usr/lib/postgresql/${version}/bin:${PATH}"
# pg_config
case "$target" in
install)
make clean && make && sudo env PATH="${PATH}" make install
;;
installcheck)
rm -f "regression.${version}.diffs" "regression.${version}.out"
PGPORT="${port}" make installcheck
if [ -e regression.diffs ]; then
cp regression.diffs "regression.${version}.diffs"
fi
if [ -e regression.out ]; then
cp regression.out "regression.${version}.out"
fi
;;
*)
usage
esac
done < .versions