]> arthur.barton.de Git - bup.git/commit - lib/bup/t/thelpers.py
Add a batchpipe() command to helpers that behaves somewhat like xargs(1).
authorRob Browning <rlb@defaultvalue.org>
Thu, 8 May 2014 18:52:25 +0000 (13:52 -0500)
committerRob Browning <rlb@defaultvalue.org>
Thu, 8 May 2014 18:52:30 +0000 (13:52 -0500)
commitb81d49d349c279399f81a02448b2185b6a1cbcd9
tree884987a48a460d81885eef65d36b2546ed0b020e
parentb72365ad597edbc528da5b93528fc3a67a18d58e
Add a batchpipe() command to helpers that behaves somewhat like xargs(1).

Add batchpipe(), which will yield the output produced by calling a
given external command with a given list of arguments.

The resulting output may be provided in chunks, from multiple
invocations of the command, if the limits imposed by ARG_MAX make that
necessary.

See http://www.in-ulm.de/~mascheck/various/argmax/ for details, but
note that batchpipe() takes the additional precaution of adding room
for the argv pointers in addition to the envp pointers.

Signed-off-by: Rob Browning <rlb@defaultvalue.org>
lib/bup/helpers.py
lib/bup/t/thelpers.py