postgresql/postgresql-install-alternatives
Reinhard Max 7fec1e465b - bsc#1230423: Relax the dependency of extensions on the server
versopn from exact major.minor to greater or equal, after Tom
  Lane confirmed on the PostgreSQL packagers list that ABI
  stability is being taken care of between minor releases.

OBS-URL: https://build.opensuse.org/package/show/server:database:postgresql/postgresql?expand=0&rev=156
2024-09-12 08:30:29 +00:00

37 lines
630 B
Bash

#!/bin/bash
shopt -s nullglob
if test "$#" -ne 1; then
echo "usage: $0 pgversion" 1>&2
exit 1
fi
PRIO=$1
case "$PRIO" in
postgresql*)
PRIO="${PRIO##postgresql}"
;;
esac
PGBASEDIR=/usr/lib/postgresql$PRIO
if [ $PRIO -lt 80 ] ; then
PRIO="${PRIO}0"
fi
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