]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
patman: RunPipe() should not pipe stdout/stderr unless asked
authorSimon Glass <sjg@chromium.org>
Sat, 6 Sep 2014 01:00:09 +0000 (19:00 -0600)
committerSimon Glass <sjg@chromium.org>
Tue, 9 Sep 2014 22:38:24 +0000 (16:38 -0600)
RunPipe() currently pipes the output of stdout and stderr to a pty, but
this is not the intended behaviour. Fix it.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/patman/command.py
tools/patman/gitutil.py

index 449d3d0e0352861bf4e9ba6556c0cbfc1f9ab3b5..7212fdfd40a1b45fd0d7c797dda647f59c7cce7b 100644 (file)
@@ -48,6 +48,8 @@ def RunPipe(pipe_list, infile=None, outfile=None,
     last_pipe = None
     pipeline = list(pipe_list)
     user_pipestr =  '|'.join([' '.join(pipe) for pipe in pipe_list])
+    kwargs['stdout'] = None
+    kwargs['stderr'] = None
     while pipeline:
         cmd = pipeline.pop(0)
         if last_pipe is not None:
index 80edc7c2c6ca0b1072abb247605b8d0ee023b7f1..b68df5d72e7ffa525b84b622840eedce13358a4e 100644 (file)
@@ -152,7 +152,8 @@ def Checkout(commit_hash, git_dir=None, work_tree=None, force=False):
     if force:
         pipe.append('-f')
     pipe.append(commit_hash)
-    result = command.RunPipe([pipe], capture=True, raise_on_error=False)
+    result = command.RunPipe([pipe], capture=True, raise_on_error=False,
+                             capture_stderr=True)
     if result.return_code != 0:
         raise OSError, 'git checkout (%s): %s' % (pipe, result.stderr)
 
@@ -163,7 +164,8 @@ def Clone(git_dir, output_dir):
         commit_hash: Commit hash to check out
     """
     pipe = ['git', 'clone', git_dir, '.']
-    result = command.RunPipe([pipe], capture=True, cwd=output_dir)
+    result = command.RunPipe([pipe], capture=True, cwd=output_dir,
+                             capture_stderr=True)
     if result.return_code != 0:
         raise OSError, 'git clone: %s' % result.stderr
 
@@ -179,7 +181,7 @@ def Fetch(git_dir=None, work_tree=None):
     if work_tree:
         pipe.extend(['--work-tree', work_tree])
     pipe.append('fetch')
-    result = command.RunPipe([pipe], capture=True)
+    result = command.RunPipe([pipe], capture=True, capture_stderr=True)
     if result.return_code != 0:
         raise OSError, 'git fetch: %s' % result.stderr