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

Side by Side Diff: remoting/dark_and_candle_and_light.py

Issue 10392172: Move remoting dark/candle/light steps to external script (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: improve argument passing Created 8 years, 7 months 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
OLDNEW
(Empty)
1 #!/usr/bin/env python
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
4 # found in the LICENSE file.
5
6 """Run 'dark', 'candle', and 'light', to confirm that an msi can be unpacked
7 repacked successfully."""
8
9 from optparse import OptionParser
10 import os
11 import subprocess
12 import sys
13
14 def run(command, filter=None):
15 popen = subprocess.Popen(
16 command, stdout=subprocess.PIPE, stderr=subprocess.STDOUT)
17 out, _ = popen.communicate()
18 for line in out.splitlines():
19 if filter and line.strip() != filter:
20 print line
21 return popen.returncode
22
23 def main():
24 parser = OptionParser()
25 parser.add_option('--wix_path', dest='wix_path')
26 parser.add_option('--input', dest='input')
27 parser.add_option('--intermediate_root', dest='intermediate_root')
28 parser.add_option('--intermediate_dir', dest='intermediate_dir')
29 parser.add_option('--output', dest='output')
30 options, args = parser.parse_args()
31 if args:
32 parser.error("no positional arguments expected")
33 parameters = dict(options.__dict__)
34
35 dark_template = ('%(wix_path)s\\dark ' +
36 '-nologo ' +
37 '%(input)s ' +
38 '-o %(intermediate_root)s.wxs ' +
39 '-x %(intermediate_dir)s')
40 rc = run(dark_template % parameters)
41 if rc:
42 return rc
43
44 candle_template = ('%(wix_path)s\\candle ' +
45 '-nologo ' +
46 '%(intermediate_root)s.wxs ' +
47 '-o %(intermediate_root)s.wixobj ' +
48 '-ext %(wix_path)s\\WixFirewallExtension.dll')
49 rc = run(candle_template % parameters,
50 os.path.basename(parameters['intermediate_root']) + '.wxs')
51 if rc:
52 return rc
53
54 light_template = ('%(wix_path)s\\light ' +
55 '-nologo ' +
56 '%(intermediate_root)s.wixobj ' +
57 '-o %(output)s ' +
58 '-ext %(wix_path)s\\WixFirewallExtension.dll ' +
59 '-sw1076 ')
60 rc = run(light_template % parameters)
61 if rc:
62 return rc
63
64 if __name__ == "__main__":
65 sys.exit(main())
OLDNEW
« no previous file with comments | « remoting/candle_and_light.py ('k') | remoting/remoting.gyp » ('j') | remoting/remoting.gyp » ('J')

Powered by Google App Engine
This is Rietveld 408576698