[cyphesis-cpp] 01/01: Reverse illegal conffile changes

Olek Wojnar olek-guest at moszumanska.debian.org
Tue Sep 29 05:08:16 UTC 2015


This is an automated email from the git hooks/post-receive script.

olek-guest pushed a commit to branch conf_fix
in repository cyphesis-cpp.

commit 047cf0dcc2eff4f87130023b7ca27c4630fefcf4
Author: Olek Wojnar <olek-dev at wojnar.org>
Date:   Mon Sep 28 23:16:10 2015 -0500

    Reverse illegal conffile changes
    
    Older versions of these maintainer scripts would change conffiles without
    the express direction of the user. The new preinst file reverses these
    changes to allow proper upgrades.
---
 debian/changelog            |  6 ++++++
 debian/cyphesis-cpp.preinst | 27 +++++++++++++++++++++++++++
 2 files changed, 33 insertions(+)

diff --git a/debian/changelog b/debian/changelog
index 41ade21..5aa972d 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+cyphesis-cpp (0.6.0-4) UNRELEASED; urgency=medium
+
+  * d/preinst: Reverse illegal conffile changes from old maintainer scripts
+
+ -- Olek Wojnar <olek-dev at wojnar.org>  Tue, 29 Sep 2015 00:05:31 -0500
+
 cyphesis-cpp (0.6.0-3) unstable; urgency=medium
 
   * Prevent d/postinst from violating policy (Closes: #767818)
diff --git a/debian/cyphesis-cpp.preinst b/debian/cyphesis-cpp.preinst
new file mode 100644
index 0000000..e2efa63
--- /dev/null
+++ b/debian/cyphesis-cpp.preinst
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+set -e
+
+# Reverse illegal conffile changes from old package versions.
+# Can be removed once versions older than 0.6.0-4 are no longer maintained.
+CONFFILE=/etc/cyphesis/cyphesis.vconf
+case "$1" in
+    install|upgrade)
+        if dpkg --compare-versions "0.6.0-4" gt-nl "$2" ;
+        then
+            sed -e "s/^.*dbserver *=.*/dbserver=\"darkstar\"/" \
+            -e "s/^.*usemetaserver *=.*/usemetaserver=\"true\"/" \
+            < $CONFFILE \
+            > $CONFFILE.tmp
+            mv $CONFFILE.tmp $CONFFILE
+        fi
+        ;;
+    abort-upgrade)
+        ;;
+
+    *)
+        echo "Unknown preinst argument \`$1'" >&2
+        ;;
+esac
+
+#DEBHELPER#

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-games/cyphesis-cpp.git



More information about the Pkg-games-commits mailing list