[Python-modules-commits] r4042 - in packages/libapache2-mod-python/trunk/debian (2 files)

piotr at users.alioth.debian.org piotr at users.alioth.debian.org
Thu Dec 27 19:39:39 UTC 2007


    Date: Thursday, December 27, 2007 @ 19:39:39
  Author: piotr
Revision: 4042

remove/restore mod_python.load file while upgrading/downgrading/removing/purging package

Modified:
  packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst
  packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postrm

Modified: packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst
===================================================================
--- packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst	2007-12-27 16:36:49 UTC (rev 4041)
+++ packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postinst	2007-12-27 19:39:39 UTC (rev 4042)
@@ -5,14 +5,17 @@
 # Source debconf library
 . /usr/share/debconf/confmodule
 
-MOD_PYTHON_LOAD=/etc/apache2/mods-enabled/python.load
+# mod_python.load renamed to python.load in 3.3.1-3
+test -L /etc/apache2/mods-enabled/mod_python.load && rm -f /etc/apache2/mods-enabled/mod_python.load
+test -e /etc/apache2/mods-available/mod_python.load && rm -f /etc/apache2/mods-available/mod_python.load
 
+PYTHON_LOAD=/etc/apache2/mods-enabled/python.load
 if [ "$1" = "configure" -o "$1" = "reconfigure" ]; then
     db_get libapache2-mod-python/enable_module
     if [ "$RET" = "true" ]; then
-        test ! -e $MOD_PYTHON_LOAD -o -L $MOD_PYTHON_LOAD && ln -sf ../mods-available/python.load $MOD_PYTHON_LOAD
+        test ! -e $PYTHON_LOAD -o -L $PYTHON_LOAD && ln -sf ../mods-available/python.load $PYTHON_LOAD
     else
-        test -L $MOD_PYTHON_LOAD && rm -f $MOD_PYTHON_LOAD
+        test -L $PYTHON_LOAD && rm -f $PYTHON_LOAD
     fi
 fi
 

Modified: packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postrm
===================================================================
--- packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postrm	2007-12-27 16:36:49 UTC (rev 4041)
+++ packages/libapache2-mod-python/trunk/debian/libapache2-mod-python.postrm	2007-12-27 19:39:39 UTC (rev 4042)
@@ -6,6 +6,16 @@
     fi
 fi
 
+# mod_python.load renamed to python.load in 3.3.1-3
+if dpkg --compare-versions "$2" lt-nl "3.3.1-3"; then
+    # downgrading to < 3.3.1-3 -- we have to restore pseudo conffile
+    if [ ! -e /etc/apache2/mods-available/mod_python.load ]; then
+        echo "LoadModule python_module /usr/lib/apache2/modules/mod_python.so" > /etc/apache2/mods-available/mod_python.load
+    fi
+elif [ -e /etc/apache2/mods-available/mod_python.load ]; then
+    rm -f /etc/apache2/mods-available/mod_python.load
+fi
+
 #DEBHELPER#
 
 exit 0




More information about the Python-modules-commits mailing list