introduce checked_pipeline / unchecked_pipeline helper utils
introduce checked_pipeline / unchecked_pipeline helper utils

for running a cmd1 | cmd2 pipeline; motivated by the desire to run:

	git archive ... | gzip -n

(given that we still can't specify --format=tar.gz)

Note that this is generalizable to any number of commands, but until
we need more than two, this "exactly 2" version is slightly simpler.

Note that closing p1.stdout (which is the read-end of the pipe which
p1's stdout writes to) is necessary to prevent deadlock if p2 exits
early without processing all its input (ie, p1's output), as python
will still have its read end of p1.stdout open so p1's writes will
block.

Setting p1.stdout = None is to avoid confusing the Popen object with
having a pipe object for its stdout which is no longer readable since
it's closed.  (This is mainly an issue if p1.communicate() is called
instead of p1.wait())


(SOFTWARE-3568)

opensciencegrid/osg-build,matyasselmeci/osg-build,matyasselmeci/osg-build,opensciencegrid/osg-build