3 bup_python="$(dirname "$0")/bup-python" || exit $?
4 exec "$bup_python" "$0" ${1+"$@"}
7 import os, sys, subprocess, struct
8 from bup import options
9 from bup.helpers import *
11 # Give the subcommand exclusive access to stdin.
12 orig_stdin = os.dup(0)
13 devnull = os.open('/dev/null', os.O_RDONLY)
18 bup mux command [arguments...]
21 o = options.Options(optspec)
22 (opt, flags, extra) = o.parse(sys.argv[1:])
24 o.fatal('command is required')
28 debug2('bup mux: starting %r\n' % (extra,))
30 outr, outw = os.pipe()
31 errr, errw = os.pipe()
36 p = subprocess.Popen(subcmd, stdin=orig_stdin, stdout=outw, stderr=errw,
40 sys.stdout.write('BUPMUX')
42 mux(p, sys.stdout.fileno(), outr, errr)
48 debug1('%s exited with code %d\n' % (extra[0], prv))
50 debug1('bup mux: done\n')