r888 - in /zope-debhelper/trunk: autoscripts/config-dzinstance autoscripts/postinst-dzinstance autoscripts/postrm-dzinstance autoscripts/preinst-dzinstance autoscripts/prerm-dzinstance debian/changelog dh_installzope dh_installzopeinstance

kobold at users.alioth.debian.org kobold at users.alioth.debian.org
Sat Jun 16 10:28:29 UTC 2007


Author: kobold
Date: Sat Jun 16 10:28:29 2007
New Revision: 888

URL: http://svn.debian.org/wsvn/pkg-zope/?sc=1&rev=888
Log:
Added support for a Zope-Database field in *.dzinstance files.

Modified:
    zope-debhelper/trunk/autoscripts/config-dzinstance
    zope-debhelper/trunk/autoscripts/postinst-dzinstance
    zope-debhelper/trunk/autoscripts/postrm-dzinstance
    zope-debhelper/trunk/autoscripts/preinst-dzinstance
    zope-debhelper/trunk/autoscripts/prerm-dzinstance
    zope-debhelper/trunk/debian/changelog
    zope-debhelper/trunk/dh_installzope
    zope-debhelper/trunk/dh_installzopeinstance

Modified: zope-debhelper/trunk/autoscripts/config-dzinstance
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/autoscripts/config-dzinstance?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/autoscripts/config-dzinstance (original)
+++ zope-debhelper/trunk/autoscripts/config-dzinstance Sat Jun 16 10:28:29 2007
@@ -2,6 +2,7 @@
 INSTANCE=#DZ-INSTANCE#
 ZVER=#DZ-ZVER#
 PORT=#DZ-PORT#
+DATABASE=#DZ-DATABASE#
 
 # if we do not have debconf, we just skip this
 test -f /usr/share/debconf/confmodule || exit 0
@@ -21,6 +22,7 @@
 while true; do
 
     if [ -d /var/lib/zope$ZVER/instance/$INSTANCE ] && \
+         [ "$DATABASE" != "ZEO" ] && \
          [ ! -f /var/lib/zope$ZVER/instance/$INSTANCE/var/Data.fs ]; then
         FIRST_STATE=1
     else
@@ -127,17 +129,33 @@
             fi
             ;;
         5)
+            if [ "$DATABASE" == "ZEO" ]; then
+                db_register zope-common/instance-zeo-port $PKG/instance-zeo-port
+                db_subst $PKG/instance-zeo-port instance "$INSTANCE" || true
+                db_fget $PKG/instance-zeo-port seen
+                if [ "$RET" = false ]; then
+                    db_set $PKG/instance-zeo-port "8100" || true
+                fi
+                if db_go; then
+                    STATE=6
+                else
+                    STATE=4
+                fi
+            else
+                STATE=6
+            fi
+            ;;
+        6)
             db_register zope-common/keep-data-on-purge $PKG/keep-data-on-purge
             db_subst $PKG/keep-data-on-purge instance "$INSTANCE" || true
             db_subst $PKG/keep-data-on-purge zver "$ZVER" || true
             db_input high $PKG/keep-data-on-purge || true
             if db_go; then
-                STATE=6
+                STATE=7
             else
-                STATE=4
+                STATE=5
             fi
             ;;
-
         *)
             break
     esac

Modified: zope-debhelper/trunk/autoscripts/postinst-dzinstance
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/autoscripts/postinst-dzinstance?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/autoscripts/postinst-dzinstance (original)
+++ zope-debhelper/trunk/autoscripts/postinst-dzinstance Sat Jun 16 10:28:29 2007
@@ -1,6 +1,7 @@
 PKG=#DZ-PKG#
 INSTANCE=#DZ-INSTANCE#
 ZVER=#DZ-ZVER#
+DATABASE=#DZ-DATABASE#
 
 add_products()
 {
@@ -25,6 +26,7 @@
         fi
     else
         if [ -d /var/lib/zope$ZVER/instance/$INSTANCE ] && \
+                [ "$DATABASE" != "ZEO" ] && \
                 [ ! -f /var/lib/zope$ZVER/instance/$INSTANCE/var/Data.fs ]; then
             db_get $PKG/remove-instance-without-data
             removal="$RET"
@@ -46,10 +48,19 @@
         db_get $PKG/instance-http-port
         port="$RET"
         
+        if [ "$DATABASE" == "ZODB" ]; then
+            db_get $PKG/instance-zeo-port
+            zeoport="$RET"
+            dzhandle -z $ZVER make-zeoinstance $INSTANCE $zeoport
+            ZEOSERVER="--zeo-server=\"localhost:$zeoport\""
+        else
+            ZEOSERVER=""
+        fi
+
         # set the install policy to manual
         if dzhandle -z $ZVER make-instance -u "$user:$password" $INSTANCE \
             --addon-mode=#DZ-ADDON-MODE# --restart=#DZ-RESTARTPOLICY# -t #DZ-ADDON-TECHNIQUE# \
-            --service-port "$port" #DZ-SKELETON#
+            --service-port "$port" $ZEOSERVER #DZ-SKELETON#
         then
             # overwrite password in debconf database
             db_set $PKG/admin-password ""

Modified: zope-debhelper/trunk/autoscripts/postrm-dzinstance
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/autoscripts/postrm-dzinstance?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/autoscripts/postrm-dzinstance (original)
+++ zope-debhelper/trunk/autoscripts/postrm-dzinstance Sat Jun 16 10:28:29 2007
@@ -1,6 +1,7 @@
 PKG=#DZ-PKG#
 INSTANCE=#DZ-INSTANCE#
 ZVER=#DZ-ZVER#
+DATABASE=#DZ-DATABASE#
 
 if [ -e /usr/share/debconf/confmodule ]; then
     . /usr/share/debconf/confmodule
@@ -16,6 +17,9 @@
     ;;
 
   remove)
+    if [ "$DATABASE" == "ZEO" ]; then
+        dzhandle -z $ZVER zeoctl $INSTANCE stop || true
+    fi
     dzhandle -z $ZVER zopectl $INSTANCE stop || true
     dzhandle -z $ZVER remove-instance $INSTANCE || true
     ;;
@@ -25,6 +29,9 @@
     if [ "$RET" = yes ]; then
 	    echo >&2 "$PKG is configured to keep the data file on purge"
     else
+        if [ "$DATABASE" == "ZEO" ]; then
+            dzhandle -z $ZVER purge-zeoinstance $INSTANCE || true
+        fi
         rm -rf /var/lib/zope$ZVER/instance/$INSTANCE \
                /var/log/zope$ZVER/$INSTANCE \
                /etc/zope$ZVER/$INSTANCE

Modified: zope-debhelper/trunk/autoscripts/preinst-dzinstance
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/autoscripts/preinst-dzinstance?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/autoscripts/preinst-dzinstance (original)
+++ zope-debhelper/trunk/autoscripts/preinst-dzinstance Sat Jun 16 10:28:29 2007
@@ -1,10 +1,14 @@
 PKG=#DZ-PKG#
 INSTANCE=#DZ-INSTANCE#
 ZVER=#DZ-ZVER#
+DATABASE=#DZ-DATABASE#
 
 case "$1" in
     install|upgrade)
 	if [ "$1" = "upgrade" ]; then
+        if [ "$DATABASE" == "ZEO" ]; then
+	        dzhandle -z $ZVER zeoctl $INSTANCE stop || true
+        fi
 	    dzhandle -z $ZVER zopectl $INSTANCE stop || true
 	fi
         ;;

Modified: zope-debhelper/trunk/autoscripts/prerm-dzinstance
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/autoscripts/prerm-dzinstance?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/autoscripts/prerm-dzinstance (original)
+++ zope-debhelper/trunk/autoscripts/prerm-dzinstance Sat Jun 16 10:28:29 2007
@@ -1,6 +1,7 @@
 PKG=#DZ-PKG#
 INSTANCE=#DZ-INSTANCE#
 ZVER=#DZ-ZVER#
+DATABASE=#DZ-DATABASE#
 
 [ -n "$(echo $INSTANCE)" ] || exit 1
 
@@ -14,6 +15,9 @@
 
 case "$1" in
   remove|upgrade)
+    if [ "$DATABASE" == "ZEO" ]; then
+        dzhandle -z $ZVER zeoctl $INSTANCE stop || true
+    fi
     dzhandle -z $ZVER zopectl $INSTANCE stop || true
     remove_products || true
     ;;

Modified: zope-debhelper/trunk/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/debian/changelog?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/debian/changelog (original)
+++ zope-debhelper/trunk/debian/changelog Sat Jun 16 10:28:29 2007
@@ -1,3 +1,10 @@
+zope-debhelper (0.3.8) unstable; urgency=low
+
+  * dh_installzopeinstance: added support for a Zope-Database field in
+    .dzinstance files.
+
+ -- Fabio Tranchitella <kobold at debian.org>  Fri, 15 Jun 2007 17:32:46 +0200
+
 zope-debhelper (0.3.7) unstable; urgency=low
 
   * dh_installzopeinstance and appropriate autoscripts:

Modified: zope-debhelper/trunk/dh_installzope
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/dh_installzope?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/dh_installzope (original)
+++ zope-debhelper/trunk/dh_installzope Sat Jun 16 10:28:29 2007
@@ -126,7 +126,7 @@
 
 sub addzopesubstvars {
     my ($package, %fields) = @_;
-    my ($var) = "zope-common (>= 0.5.26), ";
+    my ($var) = "zope-common (>= 0.5.34), ";
     my (@versions) = ();
     my ($minor) = "0";
 

Modified: zope-debhelper/trunk/dh_installzopeinstance
URL: http://svn.debian.org/wsvn/pkg-zope/zope-debhelper/trunk/dh_installzopeinstance?rev=888&op=diff
==============================================================================
--- zope-debhelper/trunk/dh_installzopeinstance (original)
+++ zope-debhelper/trunk/dh_installzopeinstance Sat Jun 16 10:28:29 2007
@@ -103,7 +103,7 @@
 
 sub addzopesubstvars {
 	my ($package, %fields) = @_;
-	addsubstvar($package, "zope:Depends", "zope-common (>= 0.5.33), zope" . $fields{'ZopeVersion'});
+	addsubstvar($package, "zope:Depends", "zope-common (>= 0.5.34), zope" . $fields{'ZopeVersion'});
 }
 
 my @autoscripts = ('config', 'preinst', 'postinst', 'prerm', 'postrm');
@@ -190,6 +190,10 @@
 				$dzinstance{'Skeleton'} = '';
 			}
 			
+			if (!$dzinstance{'Zope-Database'}) {
+				$dzinstance{'Zope-Database'} = 'ZODB';
+			}
+	
 
 			if (!$dh{NOSCRIPTS}) {
 				foreach my $script (@autoscripts) {
@@ -203,6 +207,7 @@
 						   "s,#DZ-RESTARTPOLICY#,$dzinstance{'RestartPolicy'},;" .
 						   "s,#DZ-PRODUCTS#,$dzinstance{'Products'},;" .
 						   "s,#DZ-SKELETON#,$dzinstance{'Skeleton'},;",
+						   "s,#DZ-DATABASE#,$dzinstance{'Zope-Database'},;",
 						  );
 				}
 			}




More information about the pkg-zope-commits mailing list