[Pkg-scicomp-commits] cpushare/branches/etch/debian

Sam Hocevar sam at zoy.org
Thu Apr 10 20:04:57 UTC 2008


SVN commit 2395 by sho:

  * Support python-twisted-core 2.4.


 M  +1 -1      cpushare/branches/etch/debian/control  
 M  +12 -1     cpushare/branches/etch/debian/cpushare.init  
 M  +1 -1      cpushare/branches/etch/debian/rules  


--- cpushare/branches/etch/debian/control #2394:2395
@@ -8,7 +8,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/branches/etch/debian/cpushare.init #2394:2395
@@ -53,14 +53,23 @@
 	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
+		(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"
+	    else
+		nice -n "$CPUSHARE_NICE" python -W ignore $DAEMON -r poll -u "$CPUSHARE_USER" -g "$CPUSHARE_GROUP" --logfile "$LOGFILE" --pidfile "$PIDFILE" cpushare --order "$order"
+	    fi
 	    case "$?" in
 		1|2) FAIL=1 ;;
 	    esac
@@ -75,8 +84,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
--- cpushare/branches/etch/debian/rules #2394:2395
@@ -46,7 +46,7 @@
 	dh_installdirs -p cpushare \
 	  /usr/lib/`pyversions -d`/site-packages/cpushare \
 	  /usr/lib/`pyversions -d`/site-packages/twisted/plugins
-	dh_install cpushare/*.py /usr/lib/`pyversions -d`/site-packages/cpushare/
+	dh_install cpushare/*.py cpushare/*.tml /usr/lib/`pyversions -d`/site-packages/cpushare/
 	dh_install twisted/plugins/*.py /usr/lib/`pyversions -d`/site-packages/twisted/plugins/
 	dh_install debian/default/cpushare /etc/default/
 	dh_install seccomp-loader bytecode-safe bytecode-malicious bytecode*.bin seccomp-test /usr/lib/cpushare/



More information about the Pkg-scicomp-commits mailing list