OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 3 # Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file |
4 # for details. All rights reserved. Use of this source code is governed by a | 4 # for details. All rights reserved. Use of this source code is governed by a |
5 # BSD-style license that can be found in the LICENSE file. | 5 # BSD-style license that can be found in the LICENSE file. |
6 | 6 |
7 # Script to create snapshot files. | 7 # Script to create snapshot files. |
8 | 8 |
9 import getopt | 9 import getopt |
10 import optparse | 10 import optparse |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 command = [ options.executable ] + script_args | 115 command = [ options.executable ] + script_args |
116 if options.verbose: | 116 if options.verbose: |
117 print ' '.join(command) | 117 print ' '.join(command) |
118 pipe = subprocess.Popen(command, | 118 pipe = subprocess.Popen(command, |
119 stdout=subprocess.PIPE, | 119 stdout=subprocess.PIPE, |
120 stderr=subprocess.PIPE) | 120 stderr=subprocess.PIPE) |
121 out, error = pipe.communicate() | 121 out, error = pipe.communicate() |
122 if (pipe.returncode != 0): | 122 if (pipe.returncode != 0): |
123 print out, error | 123 print out, error |
124 print "Snapshot generation failed" | 124 print "Snapshot generation failed" |
| 125 print "(Command was: '", ' '.join(command), "')" |
125 return -1 | 126 return -1 |
126 | 127 |
127 if not makeFile(options.output, options.input_cc, options.output_bin): | 128 if not makeFile(options.output, options.input_cc, options.output_bin): |
128 print "Unable to generate snapshot in C buffer form" | 129 print "Unable to generate snapshot in C buffer form" |
129 return -1 | 130 return -1 |
130 | 131 |
131 return 0 | 132 return 0 |
132 | 133 |
133 if __name__ == '__main__': | 134 if __name__ == '__main__': |
134 sys.exit(Main()) | 135 sys.exit(Main()) |
OLD | NEW |