68e3cdac9a
- Add a script for handling update-alternatives as subpackages get installed/uninstalled, so that the implementation packages don't have to repeat the logic (postgresql-install-alternatives). - Add the postgresql-test subpackage. - Fix some dependencies. - Save the enabled and running state when upgrading from the obsolete postgresql-init package. OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/postgresql?expand=0&rev=92
28 lines
494 B
Bash
28 lines
494 B
Bash
#!/bin/bash
|
|
|
|
shopt -s nullglob
|
|
|
|
if test "$#" -ne 2; then
|
|
echo "usage: $0 basedir priority" 1>&2
|
|
exit 1
|
|
fi
|
|
|
|
PGBASEDIR=$1
|
|
PRIO=$2
|
|
|
|
PGBINDIR=$PGBASEDIR/bin
|
|
|
|
for FILE in $PGBINDIR/*; do
|
|
NAME=$(basename $FILE)
|
|
DIR=/usr/bin
|
|
SLAVES="$SLAVES --slave $DIR/$NAME $NAME $FILE"
|
|
done
|
|
|
|
if test -n "$SLAVES"; then
|
|
update-alternatives --quiet --install \
|
|
/usr/lib/postgresql postgresql $PGBASEDIR $PRIO \
|
|
$SLAVES
|
|
else
|
|
update-alternatives --remove postgresql $PGBASEDIR
|
|
fi
|