diff options
-rw-r--r-- | build/extract_from_cab.py | 27 | ||||
-rw-r--r-- | chrome/chrome.gyp | 5 |
2 files changed, 30 insertions, 2 deletions
diff --git a/build/extract_from_cab.py b/build/extract_from_cab.py new file mode 100644 index 0000000..fd99184 --- /dev/null +++ b/build/extract_from_cab.py @@ -0,0 +1,27 @@ +#!/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' + 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) diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp index 5ea6dd5..e9d737cf 100644 --- a/chrome/chrome.gyp +++ b/chrome/chrome.gyp @@ -739,9 +739,10 @@ '<(PRODUCT_DIR)/<(output)', ], 'action': [ - 'expand', + 'python', + '../build/extract_from_cab.py', '..\\third_party\\directxsdk\\files\\Redist\\<(input)', - '-F:<(output)', + '<(output)', '<(PRODUCT_DIR)', ], }, |