Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(241)

Unified Diff: build/extract_from_cab.py

Issue 10409086: Quieter cab extraction (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build/extract_from_cab.py
diff --git a/build/extract_from_cab.py b/build/extract_from_cab.py
index d5410d64d8e6a0af24508da30345222c07e82377..71eae813b5f7c5b1551f31a98debeda5465a54d7 100755
--- a/build/extract_from_cab.py
+++ b/build/extract_from_cab.py
@@ -11,6 +11,14 @@ import subprocess
import sys
import tempfile
+def run_quiet(*args):
+ """Run 'expand' supressing noisy output. Returns returncode from process."""
+ popen = subprocess.Popen(args, stdout=subprocess.PIPE)
+ out, _ = popen.communicate()
+ if popen.returncode:
+ # expand emits errors to stdout, so if we fail, then print that out.
+ print out
+ return popen.returncode
def main():
if len(sys.argv) != 4:
@@ -27,8 +35,7 @@ def main():
try:
# Invoke the Windows expand utility to extract the file.
- level = subprocess.call(
- ['expand', cab_path, '-F:' + archived_file, temp_dir])
+ level = run_quiet('expand', cab_path, '-F:' + archived_file, temp_dir)
if level == 0:
# Move the output file into place, preserving expand.exe's behavior of
# paving over any preexisting file.
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698