]> arthur.barton.de Git - bup.git/commitdiff
mux: support wrapping arbitrary commands
authorRob Browning <rlb@defaultvalue.org>
Tue, 11 Nov 2014 18:09:04 +0000 (12:09 -0600)
committerRob Browning <rlb@defaultvalue.org>
Thu, 13 Nov 2014 21:45:56 +0000 (15:45 -0600)
Don't just support bup commands; allow arbitrary commands as arguments,
i.e. instead of

  bup mux BUP_SUBCOMMAND ...

support

  bup mux COMMAND ...

i.e.

  bup mux tar cvf ...

Reviewed-by: Gabriel Filion <gabster@lelutin.ca>
[rlb@defaultvalue.org: rebased to master; removed not yet applicable
 on--server-cmd.py changes]
Signed-off-by: Rob Browning <rlb@defaultvalue.org>
Tested-by: Rob Browning <rlb@defaultvalue.org>
Documentation/bup-mux.md
cmd/daemon-cmd.py
cmd/mux-cmd.py

index 10624184b3fc2232bf6c9a1130d5b4425711347e..8f76d5b584c0233c8b0fea57fa5814a7ba8e5081 100644 (file)
@@ -16,14 +16,14 @@ bup mux \<command\> [options...]
 send both data and debugging/error output over the single
 connection stream.
 
-`bup mux server` might be used in an inetd server setup.
+`bup mux bup server` might be used in an inetd server setup.
 
 # OPTIONS
 
 command
-:   the subcommand to run
+:   the command to run
 options
-:   options for command
+:   options for the command
 
 # BUP
 
index b92716fdbb3057a986e30a48f15a1b835fe479a5..c90e3e4bb3b9224c3be2039a7760340e28c1c9e8 100755 (executable)
@@ -55,7 +55,8 @@ try:
                 fd1 = os.dup(s.fileno())
                 fd2 = os.dup(s.fileno())
                 s.close()
-                sp = subprocess.Popen([path.exe(), 'mux', '--', 'server']
+                sp = subprocess.Popen([path.exe(), 'mux', '--',
+                                       path.exe(), 'server']
                                       + extra, stdin=fd1, stdout=fd2)
             finally:
                 os.close(fd1)
index 299dec9da5b854d9b056c817e0bab329daa31042..332d7bdce463a0330549b290bee5b901f3381cac 100755 (executable)
@@ -4,7 +4,7 @@ from bup import options
 from bup.helpers import *
 
 optspec = """
-bup mux command [command arguments...]
+bup mux command [arguments...]
 --
 """
 o = options.Options(optspec)
@@ -12,9 +12,7 @@ o = options.Options(optspec)
 if len(extra) < 1:
     o.fatal('command is required')
 
-cmdpath, cmdfn = os.path.split(__file__)
 subcmd = extra
-subcmd[0] = os.path.join(cmdpath, 'bup-' + subcmd[0])
 
 debug2('bup mux: starting %r\n' % (extra,))