44# found in the LICENSE file.
55
66"""Argument-less script to select what to run on the buildbots."""
7+ from __future__ import print_function
78
89import os
910import shutil
@@ -24,25 +25,25 @@ def CallSubProcess(*args, **kwargs):
2425with open (os .devnull ) as devnull_fd :
2526retcode = subprocess .call (stdin = devnull_fd , * args , ** kwargs )
2627if retcode != 0 :
27- print '@@@STEP_EXCEPTION@@@'
28+ print ( '@@@STEP_EXCEPTION@@@' )
2829sys .exit (1 )
2930
3031
3132def PrepareCmake ():
3233"""Build CMake 2.8.8 since the version in Precise is 2.8.7."""
3334if os .environ ['BUILDBOT_CLOBBER' ] == '1' :
34- print '@@@BUILD_STEP Clobber CMake checkout@@@'
35+ print ( '@@@BUILD_STEP Clobber CMake checkout@@@' )
3536shutil .rmtree (CMAKE_DIR )
3637
3738# We always build CMake 2.8.8, so no need to do anything
3839# if the directory already exists.
3940if os .path .isdir (CMAKE_DIR ):
4041return
4142
42- print '@@@BUILD_STEP Initialize CMake checkout@@@'
43+ print ( '@@@BUILD_STEP Initialize CMake checkout@@@' )
4344os .mkdir (CMAKE_DIR )
4445
45- print '@@@BUILD_STEP Sync CMake@@@'
46+ print ( '@@@BUILD_STEP Sync CMake@@@' )
4647CallSubProcess (
4748 ['git' , 'clone' ,
4849'--depth' , '1' ,
@@ -53,7 +54,7 @@ def PrepareCmake():
5354CMAKE_DIR ],
5455cwd = CMAKE_DIR )
5556
56- print '@@@BUILD_STEP Build CMake@@@'
57+ print ( '@@@BUILD_STEP Build CMake@@@' )
5758CallSubProcess (
5859 ['/bin/bash' , 'bootstrap' , '--prefix=%s' % CMAKE_DIR ],
5960cwd = CMAKE_DIR )
@@ -74,7 +75,7 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
7475if not format :
7576format = title
7677
77- print '@@@BUILD_STEP ' + title + '@@@'
78+ print ( '@@@BUILD_STEP ' + title + '@@@' )
7879sys .stdout .flush ()
7980env = os .environ .copy ()
8081if msvs_version :
@@ -89,17 +90,17 @@ def GypTestFormat(title, format=None, msvs_version=None, tests=[]):
8990retcode = subprocess .call (command , cwd = ROOT_DIR , env = env , shell = True )
9091if retcode :
9192# Emit failure tag, and keep going.
92- print '@@@STEP_FAILURE@@@'
93+ print ( '@@@STEP_FAILURE@@@' )
9394return 1
9495return 0
9596
9697
9798def GypBuild ():
9899# Dump out/ directory.
99- print '@@@BUILD_STEP cleanup@@@'
100- print 'Removing %s...' % OUT_DIR
100+ print ( '@@@BUILD_STEP cleanup@@@' )
101+ print ( 'Removing %s...' % OUT_DIR )
101102shutil .rmtree (OUT_DIR , ignore_errors = True )
102- print 'Done.'
103+ print ( 'Done.' )
103104
104105retcode = 0
105106if sys .platform .startswith ('linux' ):
@@ -128,7 +129,7 @@ def GypBuild():
128129# after the build proper that could be used for cumulative failures),
129130# use that instead of this. This isolates the final return value so
130131# that it isn't misattributed to the last stage.
131- print '@@@BUILD_STEP failures@@@'
132+ print ( '@@@BUILD_STEP failures@@@' )
132133sys .exit (retcode )
133134
134135
0 commit comments