diff options
author | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 23:23:28 +0000 |
---|---|---|
committer | scottmg@chromium.org <scottmg@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-05-22 23:23:28 +0000 |
commit | b7b5d64a0515af71384867671a3c3f9182c79024 (patch) | |
tree | 43df992d7fd242685d1109cbdd68730c43634b31 /remoting/dark_and_candle_and_light.py | |
parent | 7e2a3998069548212040fb6f07d181b98f0cb002 (diff) | |
download | chromium_src-b7b5d64a0515af71384867671a3c3f9182c79024.zip chromium_src-b7b5d64a0515af71384867671a3c3f9182c79024.tar.gz chromium_src-b7b5d64a0515af71384867671a3c3f9182c79024.tar.bz2 |
Move remoting dark/candle/light steps to external script
This avoids the need to chain the output of gyp rules, which is not supported
across generators.
See also https://chromiumcodereview.appspot.com/10381103/ and https://groups.google.com/forum/?fromgroups#!topic/gyp-developer/f_oCV-Lavpw
R=alexeypa@chromium.org
BUG=127444
NOTRY=true
Review URL: https://chromiumcodereview.appspot.com/10392172
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@138392 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'remoting/dark_and_candle_and_light.py')
-rw-r--r-- | remoting/dark_and_candle_and_light.py | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/remoting/dark_and_candle_and_light.py b/remoting/dark_and_candle_and_light.py new file mode 100644 index 0000000..47c2a09 --- /dev/null +++ b/remoting/dark_and_candle_and_light.py @@ -0,0 +1,67 @@ +#!/usr/bin/env python +# 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. + +"""Run 'dark', 'candle', and 'light', to confirm that an msi can be unpacked +repacked successfully.""" + +from optparse import OptionParser +import os +import subprocess +import sys + +def run(command, filter=None): + popen = subprocess.Popen( + command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) + out, _ = popen.communicate() + for line in out.splitlines(): + if filter and line.strip() != filter: + print line + return popen.returncode + +def main(): + parser = OptionParser() + parser.add_option('--wix_path', dest='wix_path') + parser.add_option('--input', dest='input') + parser.add_option('--intermediate_dir', dest='intermediate_dir') + parser.add_option('--output', dest='output') + options, args = parser.parse_args() + if args: + parser.error("no positional arguments expected") + parameters = dict(options.__dict__) + + parameters['basename'] = os.path.splitext(os.path.basename(options.output))[0] + + dark_template = ('%(wix_path)s\\dark ' + + '-nologo ' + + '%(input)s ' + + '-o %(intermediate_dir)s/%(basename)s.wxs ' + + '-x %(intermediate_dir)s') + rc = run(dark_template % parameters) + if rc: + return rc + + candle_template = ('%(wix_path)s\\candle ' + + '-nologo ' + + '%(intermediate_dir)s/%(basename)s.wxs ' + + '-o %(intermediate_dir)s/%(basename)s.wixobj ' + + '-ext %(wix_path)s\\WixFirewallExtension.dll') + rc = run(candle_template % parameters, parameters['basename'] + '.wxs') + if rc: + return rc + + light_template = ('%(wix_path)s\\light ' + + '-nologo ' + + '%(intermediate_dir)s/%(basename)s.wixobj ' + + '-o %(output)s ' + + '-ext %(wix_path)s\\WixFirewallExtension.dll ' + + '-sw1076 ') + rc = run(light_template % parameters) + if rc: + return rc + + return 0 + +if __name__ == "__main__": + sys.exit(main()) |