diff options
author | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 23:02:22 +0000 |
---|---|---|
committer | apatrick@chromium.org <apatrick@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-07-28 23:02:22 +0000 |
commit | dcfc4dd555f18663899e82ee4ae0d99a7198ec5f (patch) | |
tree | 92574ea39fe5728745fd79a00a2d9b36a5e420bc /build | |
parent | b1c504c1d1ee61db9a77a606e0f93dd7a165971d (diff) | |
download | chromium_src-dcfc4dd555f18663899e82ee4ae0d99a7198ec5f.zip chromium_src-dcfc4dd555f18663899e82ee4ae0d99a7198ec5f.tar.gz chromium_src-dcfc4dd555f18663899e82ee4ae0d99a7198ec5f.tar.bz2 |
Touch extracted D3DX9 dll in extract_d3dx9 action.
This was necessary because the Windows expand utility preserves the modification time from the archive. This lead to the extract_d3dx9 action firing repeatedly because the action output was older than the input.
TEST=try
BUG=none
Review URL: http://codereview.chromium.org/3067008
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@54058 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'build')
-rw-r--r-- | build/extract_from_cab.py | 27 |
1 files changed, 27 insertions, 0 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) |