[Pkg-scicomp-commits] cpushare/trunk/debian

Sam Hocevar sam at zoy.org
Sun Apr 13 11:56:35 UTC 2008


SVN commit 2403 by sho:

  * debian/cpushare.init:
    + Support older versions of python-twisted to make the job of backporters
      easier.


 M  +5 -1      cpushare/trunk/debian/changelog  
 M  +1 -1      cpushare/trunk/debian/control  
 M  +14 -1     cpushare/trunk/debian/cpushare.init  


--- cpushare/trunk/debian/changelog #2402:2403
@@ -2,10 +2,14 @@
 
   * New upstream release.
 
+  * debian/cpushare.init:
+    + Support older versions of python-twisted to make the job of backporters
+      easier.
+
   * debian/patches/210_empty_data_segment.diff:
     + Patch was applied upstream. Removing it.
 
- -- Sam Hocevar (Debian packages) <sam+deb at zoy.org>  Sun, 13 Apr 2008 13:44:39 +0200
+ -- Sam Hocevar (Debian packages) <sam+deb at zoy.org>  Sun, 13 Apr 2008 11:53:45 +0000
 
 cpushare (0.47-3) UNRELEASED; urgency=low
 
--- cpushare/trunk/debian/control #2402:2403
@@ -10,7 +10,7 @@
 
 Package: cpushare
 Architecture: amd64 i386 ppc64 powerpc
-Depends: adduser, binutils, python-twisted-core (>= 2.5), python-pyopenssl, ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
+Depends: adduser, binutils, python-twisted-core (>= 2.4), python-pyopenssl, ${python:Depends}, ${shlibs:Depends}, ${misc:Depends}
 Suggests: cpp, gcc
 Provides: ${python:Provides}
 Description: client and server for the CPUShare distributed computing platform
--- cpushare/trunk/debian/cpushare.init #2402:2403
@@ -57,14 +57,25 @@
 	for order in `find /etc/cpushare -name '*.cpu'`; do
 	    BASE="`basename "$order" | sed 's/[.]cpu$//'`"
 	    PIDFILE="/var/run/cpushare/$BASE.pid"
+	    TAPFILE="/var/run/cpushare/$BASE.tap"
 	    LOGFILE="/var/log/cpushare/$BASE.log"
 	    if [ -f "$PIDFILE" ]; then
 	        continue # already running
 	    fi
+	    if [ -f "$TAPFILE" ]; then
+	        rm -f "$TAPFILE"
+	    fi
 	    if ! grep -q '^sell_[0-9]\{1,\}_' "$order"; then
 	        continue # not a sell order
 	    fi
-	    nice -n "$CPUSHARE_NICE" python -W ignore $DAEMON -r poll -u "$CPUSHARE_USER" -g "$CPUSHARE_GROUP" --logfile "$LOGFILE" --pidfile "$PIDFILE" cpushare --order "$order"
+	    if python -c 'from twisted.application.service import IServiceMaker' >/dev/null 2>&1; then
+		# python-twisted-core does not need a .tap file
+		nice -n "$CPUSHARE_NICE" python -W ignore $DAEMON -r poll -u "$CPUSHARE_USER" -g "$CPUSHARE_GROUP" --logfile "$LOGFILE" --pidfile "$PIDFILE" cpushare --order "$order"
+	    else
+		# Fallback for older (< 2.5) versions of python-twisted-core
+		(cd /var/run/cpushare; mktap -u "$CPUSHARE_USER" -g "$CPUSHARE_GROUP" cpushare --order "$order" 2>/dev/null; mv cpushare.tap "$TAPFILE")
+		nice -n "$CPUSHARE_NICE" python -W ignore $DAEMON -r poll --logfile "$LOGFILE" --pidfile "$PIDFILE" -of "$TAPFILE"
+	    fi
 	    case "$?" in
 		1|2) FAIL=1 ;;
 	    esac
@@ -79,8 +90,10 @@
 	# because the user may have removed files.
 	for pidfile in `find /var/run/cpushare -name '*.pid'`; do
 	    BASE="`basename "$pidfile" | sed 's/[.]pid$//'`"
+	    TAPFILE="/var/run/cpushare/$BASE.tap"
 	    PID="`cat $pidfile 2>/dev/null`"
 	    kill "$PID" 2>/dev/null >/dev/null
+	    rm -f "$TAPFILE"
 	    case "$?" in
 		1|2) FAIL=1 ;;
 	    esac



More information about the Pkg-scicomp-commits mailing list