tag 665905 + patch
thanks

> Nevertheless, I'll leave it at serious for now, and try to figure out
> how to fix the situation properly.

Turns out, once I understood the problem, fixing it was rather
trivial. Patch attached.

-- 
|8]

commit b0b2a4f541c15941d0038229ee75fa5692ba2e64
Author: Gergely Nagy <alger...@balabit.hu>
Date:   Fri Apr 6 16:39:15 2012 +0200

    debian: Fix the squeeze->wheezy install-remove-install upgrade
    
    When one installed syslog-ng in squeeze, and removed it, then
    dist-upgrades to wheezy, and tries to install syslog-ng again, it
    won't automatically work, because the logrotate script was moved from
    syslog-ng to syslog-ng-core, and the preinst wasn't clever enough to
    deal with this situation.
    
    The way to solve this is to move the .disabled file back to its place
    under the following conditions (assuming the postinst is called with
    'install' as its first parameter, and the .disabled file exists):
    
     * It's either an install when there was a former syslog-ng-core
       version.
     * Or it's an install where there was no former syslog-ng-core
       installation, and the destination file doesn't exist yet.
    
    This supports both the install-remove-install case that span
    squeeze->wheezy, and works even between wheezy->wheezy versions.
    
    Reported-by: Andreas Beckmann <deb...@abeckmann.de>
    Signed-off-by: Gergely Nagy <alger...@balabit.hu>
    Closes: #665905

diff --git a/debian/syslog-ng-core.preinst b/debian/syslog-ng-core.preinst
index 1f7d8c4..9296632 100644
--- a/debian/syslog-ng-core.preinst
+++ b/debian/syslog-ng-core.preinst
@@ -2,8 +2,14 @@
 
 set -e
 
-if [ "$1" = "install" -a -n "$2" ] ; then
-  [ -f /etc/logrotate.d/syslog-ng.disabled ] && mv -f /etc/logrotate.d/syslog-ng.disabled /etc/logrotate.d/syslog-ng
+if [ "$1" = "install" ]; then
+        if [ -f /etc/logrotate.d/syslog-ng.disabled ]; then
+                if [ -n "$2" ]; then
+                        mv -f /etc/logrotate.d/syslog-ng.disabled /etc/logrotate.d/syslog-ng
+                elif [ ! -f /etc/logrotate.d/syslog-ng ]; then
+                        mv -f /etc/logrotate.d/syslog-ng.disabled /etc/logrotate.d/syslog-ng
+                fi
+        fi
 fi
 
 #DEBHELPER#

Reply via email to