| 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 env.append('USE="%s"' % ' '.join(self._build_config['useflags'])) |
| 322 | 325 |
| 323 commands.Build( | 326 commands.Build( |
| 324 self._build_root, emptytree, usepkg=self._build_config['usepkg'], | 327 self._build_root, emptytree, usepkg=self._build_config['usepkg'], |
| 325 build_autotest=(self._build_config['vm_tests'] and self._options.tests)) | 328 build_autotest=(self._build_config['vm_tests'] and self._options.tests), |
| 329 extra_env=env) |
| 326 | 330 |
| 327 # TODO(sosa): Do this optimization in a better way. | 331 # TODO(sosa): Do this optimization in a better way. |
| 328 if self._build_type == 'full': | 332 if self._build_type == 'full': |
| 329 commands.UploadPrebuilts( | 333 commands.UploadPrebuilts( |
| 330 self._build_root, self._build_config['board'], | 334 self._build_root, self._build_config['board'], |
| 331 self._build_config['rev_overlays'], [], self._build_type, | 335 self._build_config['rev_overlays'], [], self._build_type, |
| 332 False) | 336 False) |
| 333 | 337 |
| 334 commands.BuildImage(self._build_root) | 338 commands.BuildImage(self._build_root) |
| 335 | 339 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 392 def _PerformStage(self): | 396 def _PerformStage(self): |
| 393 if self._build_type in ('preflight', 'chrome'): | 397 if self._build_type in ('preflight', 'chrome'): |
| 394 commands.UploadPrebuilts( | 398 commands.UploadPrebuilts( |
| 395 self._build_root, self._build_config['board'], | 399 self._build_root, self._build_config['board'], |
| 396 self._build_config['rev_overlays'], [BuilderStage.new_binhost], | 400 self._build_config['rev_overlays'], [BuilderStage.new_binhost], |
| 397 self._build_type, self._options.chrome_rev) | 401 self._build_type, self._options.chrome_rev) |
| 398 | 402 |
| 399 commands.UprevPush(self._build_root, self._options.tracking_branch, | 403 commands.UprevPush(self._build_root, self._options.tracking_branch, |
| 400 self._build_config['board'], BuilderStage.push_overlays, | 404 self._build_config['board'], BuilderStage.push_overlays, |
| 401 self._options.debug) | 405 self._options.debug) |
| OLD | NEW |