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

Unified Diff: buildbot/cbuildbot_commands.py

Issue 6840064: Restart codereview issue 6792042 (Closed) Base URL: http://git.chromium.org/git/chromite.git@master
Patch Set: Simplify the addition of the emptyboard flag. Created 9 years, 8 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | buildbot/cbuildbot_commands_unittest.py » ('j') | lib/cros_build_lib.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: buildbot/cbuildbot_commands.py
diff --git a/buildbot/cbuildbot_commands.py b/buildbot/cbuildbot_commands.py
index b11c2b7071096179c5ef000f9c583d5d7758cb29..04d318398c6ca56044297782ccadd229c6a974f9 100644
--- a/buildbot/cbuildbot_commands.py
+++ b/buildbot/cbuildbot_commands.py
@@ -180,35 +180,40 @@ def SetupBoard(buildroot, board='x86-generic'):
enter_chroot=True)
-def Build(buildroot, emptytree, build_autotest=True, usepkg=True):
+def Build(buildroot, emptytree, build_autotest=True, usepkg=True,
+ extra_env=None):
davidjames 2011/04/19 06:38:59 extra_env={}
Peter Mayo 2011/04/19 17:43:17 I'm a little surprised that's stylisticly OK. But
"""Wrapper around build_packages."""
cwd = os.path.join(buildroot, 'src', 'scripts')
cmd = ['./build_packages']
+ env = {}
davidjames 2011/04/19 06:38:59 env = extra_env.copy() then you don't need the nex
Peter Mayo 2011/04/19 17:43:17 Done.
+ if extra_env:
+ env.update(extra_env)
if not build_autotest: cmd.append('--nowithautotest')
if not usepkg: cmd.append('--nousepkg')
if emptytree:
- cmd = ['sh', '-c', 'EXTRA_BOARD_FLAGS=--emptytree %s' % ' '.join(cmd)]
-
- cros_lib.OldRunCommand(cmd, cwd=cwd, enter_chroot=True)
+ key = 'EXTRA_BOARD_FLAGS'
+ prev = env.get(key)
+ env[key] = (prev and prev + ' ' or '') + '--emptytree'
+ cros_lib.RunCommand(cmd, cwd=cwd, enter_chroot=True, extra_env=env)
-def BuildImage(buildroot):
+def BuildImage(buildroot, extra_env=None):
_WipeOldOutput(buildroot)
cwd = os.path.join(buildroot, 'src', 'scripts')
- cros_lib.OldRunCommand(['./build_image', '--replace'], cwd=cwd,
- enter_chroot=True)
+ cros_lib.RunCommand(['./build_image', '--replace'], cwd=cwd,
+ enter_chroot=True, extra_env=extra_env)
-def BuildVMImageForTesting(buildroot):
+def BuildVMImageForTesting(buildroot, extra_env=None):
(vdisk_size, statefulfs_size) = _GetVMConstants(buildroot)
cwd = os.path.join(buildroot, 'src', 'scripts')
- cros_lib.OldRunCommand(['./image_to_vm.sh',
- '--test_image',
- '--full',
- '--vdisk_size=%s' % vdisk_size,
- '--statefulfs_size=%s' % statefulfs_size,
- ], cwd=cwd, enter_chroot=True)
+ cros_lib.RunCommand(['./image_to_vm.sh',
+ '--test_image',
+ '--full',
+ '--vdisk_size=%s' % vdisk_size,
+ '--statefulfs_size=%s' % statefulfs_size,
+ ], cwd=cwd, enter_chroot=True, extra_env=extra_env)
def RunUnitTests(buildroot, full):
« no previous file with comments | « no previous file | buildbot/cbuildbot_commands_unittest.py » ('j') | lib/cros_build_lib.py » ('J')

Powered by Google App Engine
This is Rietveld 408576698