From 3a7c6cd153d67bec2503562ca3163b2d502f6f9e Mon Sep 17 00:00:00 2001 From: Thibaut Date: Tue, 31 Dec 2019 16:03:27 +0100 Subject: [PATCH] Pitrery 3 deb (#92) * Create a symbolic link from /usr/bin/(archive|restore)_xlog to /usr/bin/(archive|restore)_wal on debian package upgrade. --- debian/changelog | 2 +- debian/postinst | 20 ++++++++++---------- debian/preinst | 14 ++++++++++++++ debian/prerm | 16 ++++++++-------- 4 files changed, 33 insertions(+), 19 deletions(-) create mode 100644 debian/preinst diff --git a/debian/changelog b/debian/changelog index b95666b..6aed1ef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -4,7 +4,7 @@ pitrery (3.0-1) buster; urgency=medium * Compatible with PostgreSQL 12 * Rename 'xlog' to 'wal' in scripts and parameters - -- Thibaut MADELAINE Fri, 27 Dec 2019 11:32:00 +000 + -- Thibaut MADELAINE Mon, 30 Dec 2019 16:44:00 +0200 pitrery (2.4-1) buster; urgency=medium diff --git a/debian/postinst b/debian/postinst index de7c13b..8c18fd3 100755 --- a/debian/postinst +++ b/debian/postinst @@ -3,14 +3,14 @@ set -e case "$1" in - upgrade) - if [ -e /usr/bin/archive_xlog_to_wal ] ; then - rm -f /usr/bin/archive_xlog_to_wal - ln -s /usr/bin/archive_wal /usr/bin/archive_xlog - fi - if [ -e /usr/bin/restore_xlog_to_wal ] ; then - rm -f /usr/bin/restore_xlog_to_wal - ln -s /usr/bin/restore_wal /usr/bin/restore_xlog - fi - ;; + configure) + if [ -e /usr/bin/archive_xlog_to_wal ] ; then + rm -f /usr/bin/archive_xlog_to_wal + ln -s /usr/bin/archive_wal /usr/bin/archive_xlog + fi + if [ -e /usr/bin/restore_xlog_to_wal ] ; then + rm -f /usr/bin/restore_xlog_to_wal + ln -s /usr/bin/restore_wal /usr/bin/restore_xlog + fi + ;; esac diff --git a/debian/preinst b/debian/preinst new file mode 100644 index 0000000..d28d0b2 --- /dev/null +++ b/debian/preinst @@ -0,0 +1,14 @@ +#! /bin/sh + +set -e + +case "$1" in + upgrade) + if [ -e /usr/bin/archive_xlog ] && [ ! -h /usr/bin/archive_xlog ] ; then + touch /usr/bin/archive_xlog_to_wal + fi + if [ -e /usr/bin/restore_xlog ] && [ ! -h /usr/bin/restore_xlog ] ; then + touch /usr/bin/restore_xlog_to_wal + fi + ;; +esac diff --git a/debian/prerm b/debian/prerm index f7b90f2..6db3fba 100755 --- a/debian/prerm +++ b/debian/prerm @@ -3,12 +3,12 @@ set -e case "$1" in - upgrade) - if [ -e /usr/bin/archive_xlog ] && [ ! -h /usr/bin/archive_xlog ] ; then - touch /usr/bin/archive_xlog_to_wal - fi - if [ -e /usr/bin/restore_xlog ] && [ ! -h /usr/bin/restore_xlog ] ; then - touch /usr/bin/restore_xlog_to_wal - fi - ;; + remove) + if [ -h /usr/bin/archive_xlog ] ; then + rm -f /usr/bin/archive_xlog + fi + if [ -h /usr/bin/restore_xlog ] ; then + rm -f /usr/bin/restore_xlog + fi + ;; esac