postgresql/postgresql-install-alternatives
Reinhard Max 68e3cdac9a - Move the start/stop script to /usr/share/postgresql
- 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
2017-11-03 12:59:51 +00:00

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