* debian/pg_clonecluster_patroni, debian/pg_createcluster_patroni: Support

both '/' and '-' as version/clustername separator.
This commit is contained in:
Michael Banck 2018-10-26 14:46:29 +01:00
parent d11ed3d0ec
commit 8aab65cd6c
3 changed files with 20 additions and 4 deletions

2
debian/changelog vendored
View file

@ -2,6 +2,8 @@ patroni (1.5.0-11) UNRELEASED; urgency=medium
[ Michael Banck ]
* debian/patroni.install: Install debian/tmp/usr/lib into patroni package.
* debian/pg_clonecluster_patroni, debian/pg_createcluster_patroni: Support
both '/' and '-' as version/clustername separator.
-- Debian PostgreSQL Maintainers <team+postgresql@tracker.debian.org> Fri, 26 Oct 2018 12:48:28 +0100

View file

@ -25,8 +25,15 @@ case $i in
esac
done
VERSION=$(echo $SCOPE | sed -e 's/\/.*//')
CLUSTER=$(echo $SCOPE | sed -e 's/.*\///')
# support both '-' and '/' as separator
if [ $(echo $SCOPE | grep -- -) ]
then
VERSION=$(echo $SCOPE | sed -e 's/-.*//')
CLUSTER=$(echo $SCOPE | sed -e 's/.*-//')
else
VERSION=$(echo $SCOPE | sed -e 's/\/.*//')
CLUSTER=$(echo $SCOPE | sed -e 's/.*\///')
fi
if [ -f /etc/postgresql/$VERSION/$CLUSTER/postgresql.conf ]
then

View file

@ -17,8 +17,15 @@ case $i in
esac
done
VERSION=$(echo $SCOPE | sed -e 's/\/.*//')
CLUSTER=$(echo $SCOPE | sed -e 's/.*\///')
# support both '-' and '/' as separator
if [ $(echo $SCOPE | grep -- -) ]
then
VERSION=$(echo $SCOPE | sed -e 's/-.*//')
CLUSTER=$(echo $SCOPE | sed -e 's/.*-//')
else
VERSION=$(echo $SCOPE | sed -e 's/\/.*//')
CLUSTER=$(echo $SCOPE | sed -e 's/.*\///')
fi
pg_createcluster $VERSION $CLUSTER
exit $?