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

Side by Side Diff: build/extract_from_cab.py

Issue 49693005: Fix spelling: "supress" -> "suppress" (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase Created 7 years, 1 month 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « build/common.gypi ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 # Copyright (c) 2012 The Chromium Authors. All rights reserved. 2 # Copyright (c) 2012 The Chromium Authors. All rights reserved.
3 # Use of this source code is governed by a BSD-style license that can be 3 # Use of this source code is governed by a BSD-style license that can be
4 # found in the LICENSE file. 4 # found in the LICENSE file.
5 5
6 """Extracts a single file from a CAB archive.""" 6 """Extracts a single file from a CAB archive."""
7 7
8 import os 8 import os
9 import shutil 9 import shutil
10 import subprocess 10 import subprocess
11 import sys 11 import sys
12 import tempfile 12 import tempfile
13 13
14 def run_quiet(*args): 14 def run_quiet(*args):
15 """Run 'expand' supressing noisy output. Returns returncode from process.""" 15 """Run 'expand' suppressing noisy output. Returns returncode from process."""
16 popen = subprocess.Popen(args, stdout=subprocess.PIPE) 16 popen = subprocess.Popen(args, stdout=subprocess.PIPE)
17 out, _ = popen.communicate() 17 out, _ = popen.communicate()
18 if popen.returncode: 18 if popen.returncode:
19 # expand emits errors to stdout, so if we fail, then print that out. 19 # expand emits errors to stdout, so if we fail, then print that out.
20 print out 20 print out
21 return popen.returncode 21 return popen.returncode
22 22
23 def main(): 23 def main():
24 if len(sys.argv) != 4: 24 if len(sys.argv) != 4:
25 print 'Usage: extract_from_cab.py cab_path archived_file output_dir' 25 print 'Usage: extract_from_cab.py cab_path archived_file output_dir'
(...skipping 28 matching lines...) Expand all
54 # The expand utility preserves the modification date and time of the archived 54 # The expand utility preserves the modification date and time of the archived
55 # file. Touch the extracted file. This helps build systems that compare the 55 # file. Touch the extracted file. This helps build systems that compare the
56 # modification times of input and output files to determine whether to do an 56 # modification times of input and output files to determine whether to do an
57 # action. 57 # action.
58 os.utime(os.path.join(output_dir, archived_file), None) 58 os.utime(os.path.join(output_dir, archived_file), None)
59 return 0 59 return 0
60 60
61 61
62 if __name__ == '__main__': 62 if __name__ == '__main__':
63 sys.exit(main()) 63 sys.exit(main())
OLDNEW
« no previous file with comments | « build/common.gypi ('k') | cc/scheduler/scheduler_state_machine.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698