OLD | NEW |
| (Empty) |
1 #!/usr/bin/python | |
2 # Copyright (c) 2010 The Chromium OS 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 """Chromite""" | |
7 | |
8 import ConfigParser | |
9 import optparse | |
10 import os | |
11 import sys | |
12 | |
13 sys.path.append(os.path.join(os.path.dirname(__file__), '../lib')) | |
14 from cros_build_lib import Die | |
15 from cros_build_lib import RunCommand | |
16 | |
17 | |
18 def chromite_chroot(buildconfig): | |
19 pass | |
20 | |
21 | |
22 def chromite_build(buildconfig): | |
23 pass | |
24 | |
25 | |
26 def chromite_image(buildconfig): | |
27 pass | |
28 | |
29 | |
30 def main(): | |
31 parser = optparse.OptionParser(usage='usage: %prog [options] build.spec') | |
32 parser.add_option('-s', '--spec', default=None, | |
33 help='Build Spec to build to') | |
34 parser.add_option('-o', '--output-dir', default='./build', | |
35 help='Output directory of build') | |
36 parser.add_option('-i', '--interactive', default=None, | |
37 help='Run in interactive build mode') | |
38 (options, inputs) = parser.parse_args() | |
39 | |
40 if not options.spec: | |
41 parser.print_help() | |
42 Die('Build Spec required') | |
43 else: | |
44 print "Using build spec.." + options.spec | |
45 | |
46 buildconfig = ConfigParser.SafeConfigParser() | |
47 buildconfig.read(options.spec) | |
48 | |
49 for section in buildconfig.sections(): | |
50 print section | |
51 for option in buildconfig.options(section): | |
52 print " ", option, "=", buildconfig.get(section, option) | |
53 | |
54 chromite_chroot(buildconfig) | |
55 chromite_build(buildconfig) | |
56 chromite_image(buildconfig) | |
57 | |
58 if __name__ == '__main__': | |
59 main() | |
OLD | NEW |