OLD | NEW |
---|---|
1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. | 1 # Copyright (c) 2011 The Chromium OS Authors. All rights reserved. |
2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
4 | 4 |
5 """Module containing the various stages that a builder runs.""" | 5 """Module containing the various stages that a builder runs.""" |
6 | 6 |
7 import os | 7 import os |
8 import re | 8 import re |
9 import sys | 9 import sys |
10 import tempfile | 10 import tempfile |
(...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
312 | 312 |
313 class BuildTargetStage(BuilderStage): | 313 class BuildTargetStage(BuilderStage): |
314 """This stage builds Chromium OS for a target. | 314 """This stage builds Chromium OS for a target. |
315 | 315 |
316 Specifically, we build Chromium OS packages and perform imaging to get | 316 Specifically, we build Chromium OS packages and perform imaging to get |
317 the images we want per the build spec.""" | 317 the images we want per the build spec.""" |
318 def _PerformStage(self): | 318 def _PerformStage(self): |
319 BuilderStage.new_binhost = self._GetPortageEnvVar(_FULL_BINHOST) | 319 BuilderStage.new_binhost = self._GetPortageEnvVar(_FULL_BINHOST) |
320 emptytree = (BuilderStage.old_binhost and | 320 emptytree = (BuilderStage.old_binhost and |
321 BuilderStage.old_binhost != BuilderStage.new_binhost) | 321 BuilderStage.old_binhost != BuilderStage.new_binhost) |
322 env=[] | |
323 if self._build_config['useflags']: | |
324 if isinstance(self._build_config['useflags'], basestring): | |
sosa
2011/04/01 00:01:11
Choose one or the other ...i.e. allow string or ar
Peter Mayo
2011/04/01 02:46:05
I think array may eventually be required, but sinc
| |
325 env.append('USE=%s' % self._build_config['useflags']) | |
326 else: | |
327 env.append('USE="%s"' % ' '.join(self._build_config['useflags'])) | |
322 | 328 |
329 # TODO(petermayo): Add other extra env variable when asked. | |
sosa
2011/04/01 00:01:11
Remove this TODO
Peter Mayo
2011/04/01 02:46:05
Done.
| |
323 commands.Build( | 330 commands.Build( |
324 self._build_root, emptytree, usepkg=self._build_config['usepkg'], | 331 self._build_root, emptytree, usepkg=self._build_config['usepkg'], |
325 build_autotest=(self._build_config['vm_tests'] and self._options.tests)) | 332 build_autotest=(self._build_config['vm_tests'] and self._options.tests), |
333 extra_env=env) | |
326 | 334 |
327 # TODO(sosa): Do this optimization in a better way. | 335 # TODO(sosa): Do this optimization in a better way. |
328 if self._build_type == 'full': | 336 if self._build_type == 'full': |
329 commands.UploadPrebuilts( | 337 commands.UploadPrebuilts( |
330 self._build_root, self._build_config['board'], | 338 self._build_root, self._build_config['board'], |
331 self._build_config['rev_overlays'], [], self._build_type, | 339 self._build_config['rev_overlays'], [], self._build_type, |
332 False) | 340 False) |
333 | 341 |
334 commands.BuildImage(self._build_root) | 342 commands.BuildImage(self._build_root) |
335 | 343 |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
392 def _PerformStage(self): | 400 def _PerformStage(self): |
393 if self._build_type in ('preflight', 'chrome'): | 401 if self._build_type in ('preflight', 'chrome'): |
394 commands.UploadPrebuilts( | 402 commands.UploadPrebuilts( |
395 self._build_root, self._build_config['board'], | 403 self._build_root, self._build_config['board'], |
396 self._build_config['rev_overlays'], [BuilderStage.new_binhost], | 404 self._build_config['rev_overlays'], [BuilderStage.new_binhost], |
397 self._build_type, self._options.chrome_rev) | 405 self._build_type, self._options.chrome_rev) |
398 | 406 |
399 commands.UprevPush(self._build_root, self._options.tracking_branch, | 407 commands.UprevPush(self._build_root, self._options.tracking_branch, |
400 self._build_config['board'], BuilderStage.push_overlays, | 408 self._build_config['board'], BuilderStage.push_overlays, |
401 self._options.debug) | 409 self._options.debug) |
OLD | NEW |