-#!/usr/bin/python
+#!/usr/bin/python2.4
# usage:
# adt-virt-chroot =[CHROOTNAME]
# uses dchroot (but problems with spaces)
import string
import urllib
import signal
+import subprocess
from optparse import OptionParser
debuglevel = None
def cmd_open(c, cu):
cmdnoargs(c, cu)
if downtmp: bomb("`open' when already open")
- downtmp = sys.exec
+ (dt, err) =
+ subpocess.Popen(args = down + 'mktemp -t -d'.split(),
+ stdin=PIPE, stdout=PIPE)
+ .communicate()
+ if err: bomb("down mktemp failed: %s" % err)
+ downtmp = dt.rstrip("\n")
def command():
cu = sys.stdin.readline()
global downtmp, cleaning
cleaning = True
if downtmp:
- pass
+ (x, err) = subprocess.Popen(args = down
+ + 'rm -rf --'.split() + [downtmp],
+ stdin=PIPE, stdout=PIPE)
+ .communicate()
+ if err: bomb("down rm -rf downtmp failed: %s" % err)
cleaning = False
def prepare():
except:
cleanup()
raise
-
-# open)
-# [ "x$downtmp" = x ] || fail '"open" when already open'
-# downtmp="$($down mktemp -t -d)"
-# echo ok
-# ;;
-# 'stop *')
-#
-#
-# *)
-# fail "unrecognised command $command"
-# ;;
-# esac
-# done
-#
-# fail 'unexpected EOF on control channel'