chiark / gitweb /
adt-run: Fix typo to make "build-needed" work (Closes #637353)
[autopkgtest.git] / virt-subproc / adt-virt-xenlvm
index 08608daba9ad6d6f321bb33b5b1f63dab365ecc3..fc8e58651a47a1a3040e44a7067a9e45dfdf9dc1 100755 (executable)
@@ -1,4 +1,4 @@
-#!/usr/bin/python2.4
+#!/usr/bin/python2.6
 #
 # adt-virt-xenlvm is part of autopkgtest
 # autopkgtest is a tool for testing Debian binary packages
@@ -31,9 +31,9 @@ import fnmatch
 import signal
 from optparse import OptionParser
 
-try: our_base = os.environ['AUTOPKGTEST_BASE']
-except KeyError: our_base = '/usr/share/autopkgtest';
-sys.path.insert(1, our_base+'/python')
+try: our_base = os.environ['AUTOPKGTEST_BASE']+'/lib'
+except KeyError: our_base = '/usr/share/autopkgtest/python';
+sys.path.insert(1, our_base)
 
 import VirtSubproc as vsp
 
@@ -90,6 +90,7 @@ def parse_args():
                        ['--','sh','-ec','echo y; exec cat'])
                vsp.down = (gain_root + ['adt-xenlvm-on-testbed'] +
                        xargs_direct + xlargs + ['--'])
+               vsp.downkind = 'shstring'
        else:
                if opts.gain_root:
                        pe('--userv and --gain-root are not compatible')
@@ -105,6 +106,7 @@ def parse_args():
                                ' and subcommand details (code=%d)' %
                                get_down.returncode)
                vsp.down = pon0.split('\0')
+               vsp.downkind = 'auxverb'
        pauses = opts.pause.split(',')
 
 def do_open():
@@ -123,7 +125,6 @@ def do_open():
        if l != "y\n":
                vsp.bomb("with-testbed sh gave wrong output `%s', not `l'"
                        % l.rstrip("\n"))
-       vsp.execute('mkdir %s' % downtmp, downp=True)   
 
 def do_close():
        global withholder
@@ -142,13 +143,16 @@ def hook_forked_inchild():
 
 def hook_open():
        hook_cleanup()
-       do_open()
+       return do_open()
+
+def hook_downtmp():
+       vsp.execute('mkdir %s' % downtmp, downp=True)
        return downtmp
 
 def hook_revert():
        check_pause('revert')
        do_close()
-       do_open()
+       return do_open()
 
 def hook_cleanup():
        check_pause('cleanup')