[Pkg-mono-svn-commits] rev 537 - monodoc/trunk/debian

Eduard Bloch blade@haydn.debian.org
Sat, 10 Apr 2004 10:34:24 -0600


Author: blade
Date: 2004-04-10 10:34:20 -0600 (Sat, 10 Apr 2004)
New Revision: 537

Removed:
   monodoc/trunk/debian/monodoc-http.prerm
Modified:
   monodoc/trunk/debian/monodoc-http.postinst
   monodoc/trunk/debian/monodoc-http.postrm
Log:
Rewrote most of pabl0's code, removed the stuff that does not belong to
the custom packages, worked around things like russian roulette
with blindly sourcing of conffiles, etc.pp.



Modified: monodoc/trunk/debian/monodoc-http.postinst
===================================================================
--- monodoc/trunk/debian/monodoc-http.postinst	2004-04-10 00:46:50 UTC (rev 536)
+++ monodoc/trunk/debian/monodoc-http.postinst	2004-04-10 16:34:20 UTC (rev 537)
@@ -1,111 +1,30 @@
 #!/bin/sh -e
 
-if test -x /usr/bin/update-menus; then update-menus; fi
-
-monodoc_xspconfd="/etc/xsp/conf.d/monodoc"
-monodoc_xspconffile="$monodoc_xspconfd/10_monodoc"
-
-monodoc_monoserverconfd="/etc/mono-server/conf.d/monodoc"
-monodoc_monoserverconffile="$monodoc_monoserverconfd/10_monodoc"
-
-monoserver_default="/etc/default/mono-server"
-monoxsp_default="/etc/default/mono-xsp"
-
-restart_firsttime() {    
-    confd="$1"
-    daemon="$2"
-    desc="$3"
-    almost_empty="`ls -lA $confd | wc -l`"
-    if [ "$almost_empty" = "2" ] ; then
-	echo "Starting $desc: $daemon"
-	/etc/init.d/$daemon start > /dev/null 2>&1 || true		
-    fi    
+update() {
+   daemon="$1"
+   cfg="$2"
+   which mono-$daemon-update.conf || return 0
+   if [ -d "/etc/$cfg" ]; then
+      mono-$daemon-update.conf || true
+   fi
+   # this is crap. Should be moved to the update programs, so they
+   # restart the daemon when and only when the config has changed
+   oldpid="`cat /var/run/mono-$daemon 2>/dev/null`"
+   if [ "$oldpid" ] && [ "`ps h -p $oldpid`" ]; then
+      /etc/init.d/mono-$daemon restart > /dev/null 2>&1 || true
+   fi
 }
 
-
-restart_xsp() {
-    #Ok, include the default file
-    . $monoxsp_default
-    #XSP is running?
-    if [ -f /var/run/mono-xsp ]; then
-        # Are we really running xsp?
-	xsp_pid=`cat /var/run/mono-xsp`
-	xsp_ps=`ps -p $xsp_pid | wc -l`
- 	# Are there any process running by that pid	
-	if [ "$xsp_ps" != "1" ]; then
-	    if [ "$start_boot" = "true" ]; then
-		echo "Restarting XSP WebServer: mono-xsp"
-		/etc/init.d/mono-xsp restart > /dev/null 2>&1 || true
-	    fi
-	else
-	    restart_firsttime "/etc/xsp/conf.d" "mono-xsp" "XSP WebServer"
-	fi
-    else
-	if [ "$start_boot" = "true" ]; then
-	    restart_firsttime "/etc/xsp/conf.d" "mono-xsp" "XSP WebServer"
-	fi
-    fi
-}
-
-restart_monoserver() {
-    #Ok, include the default file
-    . $monoserver_default
-    #MonoServer is running?
-    if [ -f /var/run/mono-server ]; then
-        # Are we really running xsp?
-	monoserver_pid=`cat /var/run/mono-server`
-	monoserver_ps=`ps -p $monoserver_pid | wc -l`
- 	# Are there any process running by that pid?
-	if [ "$xsp_ps" != "1" ]; then
-	    if [ "$start_boot" = "true" ]; then
-		echo "Restarting Mono Server: mod-mono-server"
-		/etc/init.d/mono-server restart > /dev/null 2>&1 || true
-	    fi
-	else
-	    restart_firsttime "/etc/mono-server/conf.d" "mono-server" "Mono Server"
-	fi
-    else
-	if [ "$start_boot" = "true" ]; then
-	    restart_firsttime "/etc/mono-server/conf.d" "mono-server" "Mono Server"
-	fi
-    fi
-	
-
-}
-
-
-make_conffile() {
-    echo "# This is the configuration file"
-    echo "# for the monodoc virtualhost"
-    echo "path = /usr/share/dotnet/monodoc/web"
-    echo "alias = /monodoc"
-}
-
-
 case "$1" in
-    configure)
-	if [ -x "`which mono-xsp-update.conf`" 2>/dev/null -a -d /etc/xsp ]; then
-	    mkdir -p $monodoc_xspconfd
-	    make_conffile > "$monodoc_xspconffile"		
-	    mono-xsp-update.conf
-	    restart_xsp
-	fi
-	if [ -x "`which /usr/share/dotnet/bin/mod-mono-server.exe`" 2>/dev/null -a -d /etc/mono-server ]; then
-	    mkdir -p $monodoc_monoserverconfd
-	    make_conffile > "$monodoc_monoserverconffile"		
-	    mono-server-update.conf
-	    restart_monoserver
-	fi
-	;;
-    
-    abort-upgrade|abort-remove|abort-deconfigure)
-        #Do nothing..
-    ;;
+   configure)
 
-    *)
-	;;
+   update xsp xsp
+   update server mono-server
+   ;;
+
 esac
 
+#DEBHELPER#
+
 exit 0
 
-

Modified: monodoc/trunk/debian/monodoc-http.postrm
===================================================================
--- monodoc/trunk/debian/monodoc-http.postrm	2004-04-10 00:46:50 UTC (rev 536)
+++ monodoc/trunk/debian/monodoc-http.postrm	2004-04-10 16:34:20 UTC (rev 537)
@@ -1,6 +1,30 @@
 #!/bin/sh -e
 
-if test -x /usr/bin/update-menus; then update-menus; fi
+update() {
+   daemon="$1"
+   cfg="$2"
+   which mono-$daemon-update.conf || return 0
+   if [ -d "/etc/$cfg" ]; then
+      mono-$daemon-update.conf || true
+   fi
+   # this is crap. Should be moved to the update programs, so they
+   # restart the daemon when and only when the config has changed
+   oldpid="`cat /var/run/mono-$daemon 2>/dev/null`"
+   if [ "$oldpid" ] && [ "`ps h -p $oldpid`" ]; then
+      /etc/init.d/mono-$daemon restart > /dev/null 2>&1 || true
+   fi
+}
 
+case "$1" in
+   purge|remove)
+
+   update xsp xsp
+   update server mono-server
+   ;;
+
+esac
+
+#DEBHELPER#
+
 exit 0
 

Deleted: monodoc/trunk/debian/monodoc-http.prerm
===================================================================
--- monodoc/trunk/debian/monodoc-http.prerm	2004-04-10 00:46:50 UTC (rev 536)
+++ monodoc/trunk/debian/monodoc-http.prerm	2004-04-10 16:34:20 UTC (rev 537)
@@ -1,68 +0,0 @@
-#!/bin/sh -e
-
-monodoc_xspconfd="/etc/xsp/conf.d/monodoc"
-monodoc_monoserverconfd="/etc/mono-server/conf.d/monodoc"
-
-monoserver_default="/etc/default/mono-server"
-monoxsp_default="/etc/default/mono-xsp"
-
-restart_xsp() {
-    #XSP is running?
-    if [ -f /var/run/mono-xsp ]; then
-        # Are we really running xsp?
-	xsp_pid=`cat /var/run/mono-xsp`
-	xsp_ps=`ps -p $xsp_pid | wc -l`
- 	# Are there any process running by that pid?
-	if [ "$xsp_ps" != "1" ]; then
-	    #Include default
-	    . $monoxsp_default
-	    if [ "$start_boot" = "true" ]; then
-		echo "Restarting XSP WebServer: mono-xsp"
-		/etc/init.d/mono-xsp restart > /dev/null 2>&1 || true
-	    fi
-	fi
-    fi
-}
-
-restart_monoserver() {
-    #MonoServer is running?
-    if [ -f /var/run/mono-server ]; then
-        # Are we really running xsp?
-	monoserver_pid=`cat /var/run/mono-server`
-	monoserver_ps=`ps -p $monoserver_pid | wc -l`
- 	# Are there any process running by that pid?
-	if [ "$xsp_ps" != "1" ]; then
-	    #Include default (monoserver)
-	    . $monoserver_default
-	    if [ "$start_boot" = "true" ]; then
-		echo "Restarting Mono Server: mod-mono-server"
-		/etc/init.d/mono-server restart > /dev/null 2>&1 || true
-	    fi
-	fi
-    fi
-}
-
-case "$1" in
-    remove)
-	if [ -x "`which mono-xsp-update.conf`" 2>/dev/null -a -d /etc/xsp ]; then
-	    rm -Rf $monodoc_xspconfd
-	    mono-xsp-update.conf
-	    restart_xsp
-	fi
-	if [ -x "`which /usr/share/dotnet/bin/mod-mono-server.exe`" 2>/dev/null -a -d /etc/mono-server ]; then
-	    rm -Rf $monodoc_monoserverconfd
-	    mono-server-update.conf
-	    restart_monoserver
-	fi
-	;;
-    
-    abort-upgrade|abort-remove|abort-deconfigure)
-        #Do nothing..
-    ;;
-
-    *)
-	;;
-esac
-
-exit 0
-