From cfe853e7912975be309aec12b44046b0117b980d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Delafond?= Date: Tue, 15 Oct 2024 14:01:05 +0200 Subject: [PATCH] rename conffile --- debian/aptly-api.maintscript | 1 + debian/aptly-api.postinst | 12 ------------ debian/aptly-api.postrm | 11 ++++------- debian/aptly-api.preinst | 18 ------------------ 4 files changed, 5 insertions(+), 37 deletions(-) create mode 100644 debian/aptly-api.maintscript mode change 100644 => 100755 debian/aptly-api.preinst diff --git a/debian/aptly-api.maintscript b/debian/aptly-api.maintscript new file mode 100644 index 00000000..dbc52ad4 --- /dev/null +++ b/debian/aptly-api.maintscript @@ -0,0 +1 @@ +mv_conffile /etc/aptly-api.conf /etc/aptly.conf 1.6~ diff --git a/debian/aptly-api.postinst b/debian/aptly-api.postinst index 198beec2..01edd3a1 100755 --- a/debian/aptly-api.postinst +++ b/debian/aptly-api.postinst @@ -15,15 +15,6 @@ case "$1" in # set config file permissions not world readable as it may contain secrets chown root:aptly-api /etc/aptly.conf chmod 640 /etc/aptly.conf - - if [ -f /etc/aptly-api.conf.migrate ]; then - rootDir=`grep rootDir /etc/aptly-api.conf.migrate | sed 's_/var/lib/aptly-api_~_' | sed -n 's/.\+: "\([^"]\+\)".*/\1/p'` - if [ -n "$rootDir" ]; then - sed -i 's/\(.*"rootDir": "\)[^"]*\(".*\)/\1'$rootDir'\2/' /etc/aptly.conf - fi - echo "backing up /etc/aptly-api.conf to /etc/aptly-api.conf.old..." - mv /etc/aptly-api.conf.migrate /etc/aptly-api.conf.old - fi ;; abort-upgrade|abort-remove|abort-deconfigure) @@ -35,9 +26,6 @@ case "$1" in ;; esac -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - #DEBHELPER# exit 0 diff --git a/debian/aptly-api.postrm b/debian/aptly-api.postrm index 3092cecd..78a51086 100755 --- a/debian/aptly-api.postrm +++ b/debian/aptly-api.postrm @@ -4,10 +4,10 @@ set -e case "$1" in purge|remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear) - # Only remove /var/lib/aptly-api on purge - if [ "${1}" = "purge" ] ; then - rm -rf /var/lib/aptly-api - fi + # only remove /var/lib/aptly-api on purge + if [ "${1}" = "purge" ] ; then + rm -rf /var/lib/aptly-api + fi ;; *) @@ -16,9 +16,6 @@ case "$1" in ;; esac -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - #DEBHELPER# exit 0 diff --git a/debian/aptly-api.preinst b/debian/aptly-api.preinst old mode 100644 new mode 100755 index e2543af1..2f857aed --- a/debian/aptly-api.preinst +++ b/debian/aptly-api.preinst @@ -1,24 +1,9 @@ #!/bin/sh -# -# see: dh_installdeb(1) set -e -# summary of how this script can be called: -# * `install' -# * `install' -# * `upgrade' -# * `abort-upgrade' -# for details, see http://www.debian.org/doc/debian-policy/ or -# the debian-policy package - - case "$1" in install|upgrade) - if [ -f /etc/aptly-api.conf ]; then - echo "migrating /etc/aptly-api.conf ..." - mv /etc/aptly-api.conf /etc/aptly-api.conf.migrate - fi ;; abort-upgrade) @@ -30,9 +15,6 @@ case "$1" in ;; esac -# dh_installdeb will replace this with shell code automatically -# generated by other debhelper scripts. - #DEBHELPER# exit 0