[Pkg-tcltk-commits] r1315 - in dotlrn/tags: . 2.5.0+dfsg-6+wheezy3/debian

geox-guest at alioth.debian.org geox-guest at alioth.debian.org
Sun Dec 16 18:31:20 UTC 2012


Author: geox-guest
Date: 2012-12-16 18:31:20 +0000 (Sun, 16 Dec 2012)
New Revision: 1315

Added:
   dotlrn/tags/2.5.0+dfsg-6+wheezy3/
Modified:
   dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/changelog
   dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/config
   dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/dotlrn.preinst
   dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/postinst
   dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/postrm
Log:
* Fixed aolserver restart call in postrm.
* Fixed config.local permissions in postinst.
* Importing old config.tcl or config.local database settings



Modified: dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/changelog
===================================================================
--- dotlrn/tags/2.5.0+dfsg-6+wheezy2/debian/changelog	2012-10-01 23:04:24 UTC (rev 1308)
+++ dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/changelog	2012-12-16 18:31:20 UTC (rev 1315)
@@ -1,3 +1,11 @@
+dotlrn (2.5.0+dfsg-6+wheezy3) testing-proposed-updates; urgency=low
+
+  * Fixed aolserver restart call in postrm.
+  * Fixed config.local permissions in postinst.
+  * Importing old config.tcl or config.local database settings. 
+
+ -- Hector Romojaro <hromojaro at dia.uned.es>  Thu, 25 Oct 2012 14:07:09 +0200
+
 dotlrn (2.5.0+dfsg-6+wheezy2) testing-proposed-updates; urgency=low
 
   * Fixed local config management. Closes: #688435

Modified: dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/config
===================================================================
--- dotlrn/tags/2.5.0+dfsg-6+wheezy2/debian/config	2012-10-01 23:04:24 UTC (rev 1308)
+++ dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/config	2012-12-16 18:31:20 UTC (rev 1315)
@@ -6,6 +6,31 @@
 db_version 2.0
 db_capb backup
 
+# Manage old configuration.
+if [ -f /etc/dotlrn/config.tcl.old_version ] || [ -f /etc/dotlrn/config.local ]; then
+
+    # Previous or equal to 2.5.0+dfsg-6+wheezy1
+    if [ -f /etc/dotlrn/config.tcl.old_version ]; then
+        old_configfile=$(mktemp)
+        # Retrieve old values
+        sed -n '/## Debconf changes/,/## End Debconf/p;' /etc/dotlrn/config.tcl.old_version | sed 's/^[ \t]*set\ //;/^\#/d;s/db_host/db_host=/;s/db_password/db_password=/;s/db_user/db_user=/;s/=[ \t]*/=/;' > $old_configfile
+    fi
+
+    # After 2.5.0+dfsg-6+wheezy1
+    if [ -f /etc/dotlrn/config.local ]; then
+        old_configfile=/etc/dotlrn/config.local
+    fi
+
+    # Feed debconf with them
+    db_set dotlrn/db_host $(grep "^db_host" $old_configfile | sed s/^db_host=//)
+    db_set dotlrn/dbu_name $(grep "^db_user" $old_configfile | sed s/^db_user=//)
+    db_set dotlrn/dbu_password "$(grep "^db_password" $old_configfile | sed 's/^db_password=//;s/\"//g')"
+    db_set dotlrn/dbu_confirm "$(grep "^db_password" $old_configfile | sed 's/^db_password=//;s/\"//g')"
+
+    # Delete old files if needed
+    if [ -f /etc/dotlrn/config.tcl.old_version ]; then rm -f /etc/dotlrn/config.tcl.old_version $old_configfile; fi
+fi
+
 # Reset passwords if reconfigure
 if [ "$1" = "reconfigure" ] ; then
 	db_reset dotlrn/dba_password

Modified: dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/dotlrn.preinst
===================================================================
--- dotlrn/tags/2.5.0+dfsg-6+wheezy2/debian/dotlrn.preinst	2012-10-01 23:04:24 UTC (rev 1308)
+++ dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/dotlrn.preinst	2012-12-16 18:31:20 UTC (rev 1315)
@@ -20,6 +20,8 @@
     #  
     if dpkg --compare-versions "$2" le "2.5.0+dfsg-6+wheezy1"
     then
+        # First, make a copy so we can get the old config values
+        cp /etc/dotlrn/config.tcl /etc/dotlrn/config.tcl.old_version
         # Reset config.tcl to its primordial state
         sed -i '/set db_host/,/set db_user/d' /etc/dotlrn/config.tcl
     fi

Modified: dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/postinst
===================================================================
--- dotlrn/tags/2.5.0+dfsg-6+wheezy2/debian/postinst	2012-10-01 23:04:24 UTC (rev 1308)
+++ dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/postinst	2012-12-16 18:31:20 UTC (rev 1315)
@@ -156,7 +156,7 @@
         localconfigtmp=$(mktemp)
         localconfig="/etc/dotlrn/config.local"
         cat > $localconfigtmp <<EOF
-# Local dotLRN database settings, managed by debconf.
+# Local dotLRN database settings.
 db_host=${dbserver}
 db_password=${dbu_password}
 db_port=5432
@@ -164,10 +164,15 @@
 EOF
         # Install file
         if [ -d /etc/dotlrn -a -f $localconfigtmp ]; then
+            previous_localconfig=false
+            if [ -f $localconfig ]; then previous_localconfig=true; fi
             ucf --debconf-ok $localconfigtmp $localconfig || cp -f $localconfigtmp $localconfig
             ucfr dotlrn $localconfig
-            chmod 640 $localconfig
-            chown www-data:www-data $localconfig
+            # Set permissions only if there is no previous config.local file.
+            if ! $previous_localconfig; then
+                chmod 640 $localconfig
+                chown root:www-data $localconfig
+            fi
             rm -f $localconfigtmp
         fi
 

Modified: dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/postrm
===================================================================
--- dotlrn/tags/2.5.0+dfsg-6+wheezy2/debian/postrm	2012-10-01 23:04:24 UTC (rev 1308)
+++ dotlrn/tags/2.5.0+dfsg-6+wheezy3/debian/postrm	2012-12-16 18:31:20 UTC (rev 1315)
@@ -24,8 +24,8 @@
             ucfr --purge dotlrn /etc/dotlrn/config.local
         fi
         rm -f /etc/aolserver4/conf.d/dotlrn.tcl /etc/aolserver4/conf.d/dotlrn.sh
-        # Start aolserver after removal
-        [ -f /etc/init.d/aolserver4 ] && invoke-rc.d aolserver4 start
+        # Restart aolserver after removal, only if it's already running
+        [ -f /var/run/aolserver4/dotlrn.pid ] && invoke-rc.d aolserver4 restart
 	;;
 
 	remove)
@@ -33,8 +33,8 @@
 		db_version 2.0
 
 		rm -rf /usr/share/dotlrn
-        # Start aolserver after removal
-        [ -f /etc/init.d/aolserver4 ] && invoke-rc.d aolserver4 start
+        # Restart aolserver after removal, only if it's already running
+        [ -f /var/run/aolserver4/dotlrn.pid ] && invoke-rc.d aolserver4 restart
 	;;
 
        	upgrade|failed-upgrade|abort-install|abort-upgrade|disappear)




More information about the Pkg-tcltk-commits mailing list