Chromium Code Reviews| Index: build/extract_from_cab.py |
| =================================================================== |
| --- build/extract_from_cab.py (revision 0) |
| +++ build/extract_from_cab.py (revision 0) |
| @@ -0,0 +1,29 @@ |
| +#!/usr/bin/env python |
| +# Copyright (c) 2009 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. |
| + |
| +# Extracts a single file from a CAB archive. |
| + |
| +import os |
| +import subprocess |
| +import sys |
| + |
| +if len(sys.argv) != 4: |
| + print "Usage: extract_from_cab.py cab_path archived_file output_dir" |
|
bradn
2010/07/28 18:07:01
Style guide says use consistent " or ' throughout.
|
| + sys.exit(1) |
| + |
| +[cab_path, archived_file, output_dir] = sys.argv[1:] |
| + |
| +# Invoke the Windows expand utility to extract the file. |
| +level = subprocess.call(['expand', cab_path, '-F:' + archived_file, output_dir]) |
| +if level != 0: |
| + sys.exit(level) |
| + |
| +# The expand utility preserves the modification date and time of the archived |
| +# file. Touch the extracted file. This helps build systems that compare the |
| +# modification times of input and output files to determine whether to do an |
| +# action. |
| +os.utime(os.path.join(output_dir, archived_file), None) |
| + |
| +sys.exit(0) |
|
bradn
2010/07/28 18:07:01
It defaults to this, so you can drop it.
|
| Property changes on: build\extract_from_cab.py |
| ___________________________________________________________________ |
| Added: svn:eol-style |
| + LF |