diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 07:08:56 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-23 07:08:56 +0000 |
commit | 3ea8fe2d0851618159039209591354085a137b11 (patch) | |
tree | 5e3bac034f2672b865a8d1a6d8eac1b98d5eda7a /build/extract_from_cab.py | |
parent | ca72ff29277e39031e2b409e2a593b25d0066e8a (diff) | |
download | chromium_src-3ea8fe2d0851618159039209591354085a137b11.zip chromium_src-3ea8fe2d0851618159039209591354085a137b11.tar.gz chromium_src-3ea8fe2d0851618159039209591354085a137b11.tar.bz2 |
Quieter cab extraction
Suppress stdout of 'expand' command unless there's an error.
i.e.
"""
[2294->7960/10271 ~17] ACTION content_common: extract_xinput
Microsoft (R) File Expansion Utility Version 6.1.7600.16385
Copyright (c) Microsoft Corporation. All rights reserved.
Adding ../out/Debug\tmpamaser\xinput1_3.dll to Extraction Queue
Expanding Files ....
Expanding Files Complete ...
[2164->8090/10271 ~17] ACTION content_gpu: extract_d3dx9
Microsoft (R) File Expansion Utility Version 6.1.7600.16385
Copyright (c) Microsoft Corporation. All rights reserved.
Adding ../out/Debug\tmpcxuoz9\d3dx9_43.dll to Extraction Queue
Expanding Files ....
Expanding Files Complete ...
[2163->8091/10271 ~17] ACTION content_gpu: extract_d3dcompiler
Microsoft (R) File Expansion Utility Version 6.1.7600.16385
Copyright (c) Microsoft Corporation. All rights reserved.
Adding ../out/Debug\tmploys57\D3DCompiler_43.dll to Extraction Queue
Expanding Files ....
Expanding Files Complete ...
"""
R=apatrick@chromium.org
BUG=126483
Review URL: https://chromiumcodereview.appspot.com/10409086
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138442 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build/extract_from_cab.py')
-rwxr-xr-x | build/extract_from_cab.py | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/build/extract_from_cab.py b/build/extract_from_cab.py index d5410d6..1c928af 100755 --- a/build/extract_from_cab.py +++ b/build/extract_from_cab.py @@ -1,5 +1,5 @@ #!/usr/bin/env python -# Copyright (c) 2011 The Chromium Authors. All rights reserved. +# Copyright (c) 2012 The Chromium Authors. All rights reserved. # Use of this source code is governed by a BSD-style license that can be # found in the LICENSE file. @@ -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. |