[tryton-debian-vcs] tryton-server branch debian updated. debian/3.4.0-1-3-g1fc82aa

Mathias Behrle tryton-debian-vcs at alioth.debian.org
Thu Oct 30 15:39:36 UTC 2014


The following commit has been merged in the debian branch:
https://alioth.debian.org/plugins/scmgit/cgi-bin/gitweb.cgi/?p=tryton/tryton-server.git;a=commitdiff;h=debian/3.4.0-1-3-g1fc82aa

commit 1fc82aaa956c2f554a1ac159e26e5ca06f95e5d9
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Oct 30 16:35:49 2014 +0100

    Correcting conf file handling.
    
    - Moving old configuration file as a backup to the new configuration
      directory.
    - Handling dpkg-statoverrides separately for all configuration files.

diff --git a/debian/NEWS b/debian/NEWS
index 3b05bbe..f605046 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -6,7 +6,8 @@ tryton-server (3.4.0-1) unstable; urgency=medium
   The format of the configuration file changed to a simple ini style
   format. There is no automatic migration of old configuration settings.
   So be sure to adapt /etc/tryton/trytond.conf (or whatever configuration
-  file you may use) to the new format.
+  file you may use) to the new format (the old configuration file was saved
+  to /etc/tryton/trytond.conf.pre34).
 
   As for each major release don't forget to backup your database(s) and
   then run the database update with
diff --git a/debian/tryton-server.postinst b/debian/tryton-server.postinst
index f7714e9..08eb6bc 100644
--- a/debian/tryton-server.postinst
+++ b/debian/tryton-server.postinst
@@ -3,8 +3,11 @@
 set -e
 
 TRYTON_USER="tryton"
-TRYTON_CONFFILE="/etc/tryton/trytond.conf"
-TRYTON_LOGCONFFILE="/etc/tryton/trytond_log.conf"
+TRYTON_OLDCONFFILE="/etc/trytond.conf"
+TRYTON_CONFDIR="/etc/tryton"
+TRYTON_CONFFILE="${TRYTON_CONFDIR}/trytond.conf"
+TRYTON_LOGCONFFILE="${TRYTON_CONFDIR}/trytond_log.conf"
+TRYTON_CONFFILEPRE34="${TRYTON_CONFDIR}/trytond.conf.pre34"
 TRYTON_LOGDIR="/var/log/tryton"
 TRYTON_HOMEDIR="/var/lib/tryton"
 
@@ -24,11 +27,18 @@ case "${1}" in
 		# Setting ownership and permissions on configuration file
 		# trytond uses internal defaults, if it cannot read the
 		# configuration file.
-		chown ${TRYTON_USER}:${TRYTON_USER} ${TRYTON_CONFFILE} ${TRYTON_LOGCONFFILE}
-		if ! dpkg-statoverride --list "${TRYTON_CONFFILE}" > /dev/null 2>&1
-		then
-			chmod 0440 "${TRYTON_CONFFILE}"
-			chmod 0440 "${TRYTON_LOGCONFFILE}"
+		for _ITEM in "${TRYTON_CONFFILE}" "${TRYTON_LOGCONFFILE}"
+		do
+			if ! dpkg-statoverride --list "${_ITEM}" > /dev/null 2>&1
+			then
+				chown "${TRYTON_USER}":"${TRYTON_USER}" "${_ITEM}"
+				chmod 0440 "${_ITEM}"
+			fi
+		done
+
+		# Migration from 3.2 to 3.4: backup old configuration to new configuration location
+		if [ -e "$TRYTON_OLDCONFFILE" ]; then
+			mv -f "${TRYTON_OLDCONFFILE}" "${TRYTON_CONFFILEPRE34}"
 		fi
 
 		# Restricting access to home and log directories for security reasons (private information)
diff --git a/debian/tryton-server.postrm b/debian/tryton-server.postrm
index 1ee15cf..0b2e109 100644
--- a/debian/tryton-server.postrm
+++ b/debian/tryton-server.postrm
@@ -4,8 +4,10 @@ set -e
 
 TRYTON_USER="tryton"
 TRYTON_OLDCONFFILE="/etc/trytond.conf"
-TRYTON_CONFFILE="/etc/tryton/trytond.conf"
-TRYTON_LOGCONFFILE="/etc/tryton/trytond_log.conf"
+TRYTON_CONFDIR="/etc/tryton"
+TRYTON_CONFFILE="${TRYTON_CONFDIR}/trytond.conf"
+TRYTON_LOGCONFFILE="${TRYTON_CONFDIR}/trytond_log.conf"
+TRYTON_CONFFILEPRE34="${TRYTON_CONFDIR}/trytond.conf.pre34"
 TRYTON_LOGDIR="/var/log/tryton"
 TRYTON_HOMEDIR="/var/lib/tryton"
 
@@ -26,8 +28,14 @@ case "${1}" in
 		# Removing log directory
 		rmdir --ignore-fail-on-non-empty ${TRYTON_LOGDIR} > /dev/null 2>&1 || true
 
+		# Removing (potentially) leftover old configuration backup
+		rm -f "${TRYTON_CONFFILEPRE34}"
+
 		# Removing (potentially) empty directories
-		rmdir --ignore-fail-on-non-empty ${TRYTON_HOMEDIR} > /dev/null 2>&1 || true
+		for _ITEM in "${TRYTON_CONFDIR}" "${TRYTON_LOGDIR}"
+		do
+			rmdir --ignore-fail-on-non-empty ${_ITEM} > /dev/null 2>&1 || true
+		done
 		;;
 
 	remove|upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)
commit 24a738706d8ecc85bcab1244885a1cf25b224b9a
Author: Mathias Behrle <mathiasb at m9s.biz>
Date:   Thu Oct 30 15:31:37 2014 +0100

    Adding path to the configuration file to the commands in NEWS.

diff --git a/debian/NEWS b/debian/NEWS
index 6ba6f48..3b05bbe 100644
--- a/debian/NEWS
+++ b/debian/NEWS
@@ -10,7 +10,7 @@ tryton-server (3.4.0-1) unstable; urgency=medium
 
   As for each major release don't forget to backup your database(s) and
   then run the database update with
-  # trytond --all -d <your_database_name>
+  # trytond -c /etc/tryton/trytond.conf --all -d <your_database_name>
   and restart the server with
   # service tryton-server restart
 
-- 
tryton-server



More information about the tryton-debian-vcs mailing list