Skip to content

Commit

Permalink
Pitrery 3 deb (#92)
Browse files Browse the repository at this point in the history
* Create a symbolic link from /usr/bin/(archive|restore)_xlog to /usr/bin/(archive|restore)_wal on debian package upgrade.
  • Loading branch information
madtibo authored Dec 31, 2019
1 parent e9649c0 commit 3a7c6cd
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 19 deletions.
2 changes: 1 addition & 1 deletion debian/changelog
Original file line number Diff line number Diff line change
Expand Up @@ -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 <[email protected]> Fri, 27 Dec 2019 11:32:00 +000
-- Thibaut MADELAINE <[email protected]> Mon, 30 Dec 2019 16:44:00 +0200

pitrery (2.4-1) buster; urgency=medium

Expand Down
20 changes: 10 additions & 10 deletions debian/postinst
Original file line number Diff line number Diff line change
Expand Up @@ -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
14 changes: 14 additions & 0 deletions debian/preinst
Original file line number Diff line number Diff line change
@@ -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
16 changes: 8 additions & 8 deletions debian/prerm
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 3a7c6cd

Please sign in to comment.