summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/buildman/builder.py2
-rw-r--r--tools/buildman/builderthread.py6
-rwxr-xr-xtools/buildman/buildman.py2
-rw-r--r--tools/buildman/control.py15
-rwxr-xr-xtools/genboardscfg.py26
-rw-r--r--tools/patman/checkpatch.py5
-rwxr-xr-xtools/patman/patman.py5
7 files changed, 22 insertions, 39 deletions
diff --git a/tools/buildman/builder.py b/tools/buildman/builder.py
index d5b8454..a555bd8 100644
--- a/tools/buildman/builder.py
+++ b/tools/buildman/builder.py
@@ -308,7 +308,7 @@ class Builder:
Args:
commit: Commit object that is being built
brd: Board object that is being built
- stage: Stage that we are at (distclean, config, build)
+ stage: Stage that we are at (mrproper, config, build)
cwd: Directory where make should be run
args: Arguments to pass to make
kwargs: Arguments to pass to command.RunPipe()
diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
index 32297e2..8214662 100644
--- a/tools/buildman/builderthread.py
+++ b/tools/buildman/builderthread.py
@@ -91,7 +91,7 @@ class BuilderThread(threading.Thread):
commit: Commit object that is being built
brd: Board object that is being built
stage: Stage of the build. Valid stages are:
- distclean - can be called to clean source
+ mrproper - can be called to clean source
config - called to configure for a board
build - the main make invocation - it does the build
args: A list of arguments to pass to 'make'
@@ -200,8 +200,8 @@ class BuilderThread(threading.Thread):
# If we need to reconfigure, do that now
if do_config:
- result = self.Make(commit, brd, 'distclean', cwd,
- 'distclean', *args, env=env)
+ result = self.Make(commit, brd, 'mrproper', cwd,
+ 'mrproper', *args, env=env)
result = self.Make(commit, brd, 'config', cwd,
*(args + config_args), env=env)
config_out = result.combined
diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
index 6ca8dc6..e18859b 100755
--- a/tools/buildman/buildman.py
+++ b/tools/buildman/buildman.py
@@ -118,7 +118,7 @@ parser.add_option('-u', '--show_unknown', action='store_true',
parser.add_option('-v', '--verbose', action='store_true',
default=False, help='Show build results while the build progresses')
-parser.usage = """buildman -b <branch> [options]
+parser.usage += """
Build U-Boot for all commits in a branch. Use -n to do a dry run"""
diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 98a07a2..d98e50a 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -110,15 +110,13 @@ def DoBuildman(options, args):
if count is None:
str = ("Branch '%s' not found or has no upstream" %
options.branch)
- print col.Color(col.RED, str)
- sys.exit(1)
+ sys.exit(col.Color(col.RED, str))
count += 1 # Build upstream commit also
if not count:
str = ("No commits found to process in branch '%s': "
"set branch's upstream or use -c flag" % options.branch)
- print col.Color(col.RED, str)
- sys.exit(1)
+ sys.exit(col.Color(col.RED, str))
# Work out what subset of the boards we are building
board_file = os.path.join(options.git, 'boards.cfg')
@@ -127,16 +125,14 @@ def DoBuildman(options, args):
status = subprocess.call([os.path.join(options.git,
'tools/genboardscfg.py')])
if status != 0:
- print >> sys.stderr, "Failed to generate boards.cfg"
- sys.exit(1)
+ sys.exit("Failed to generate boards.cfg")
boards = board.Boards()
boards.ReadBoards(os.path.join(options.git, 'boards.cfg'))
why_selected = boards.SelectBoards(args)
selected = boards.GetSelected()
if not len(selected):
- print col.Color(col.RED, 'No matching boards found')
- sys.exit(1)
+ sys.exit(col.Color(col.RED, 'No matching boards found'))
# Read the metadata from the commits. First look at the upstream commit,
# then the ones in the branch. We would like to do something like
@@ -182,8 +178,7 @@ def DoBuildman(options, args):
gnu_make = command.Output(os.path.join(options.git,
'scripts/show-gnu-make')).rstrip()
if not gnu_make:
- print >> sys.stderr, 'GNU Make not found'
- sys.exit(1)
+ sys.exit('GNU Make not found')
# Create a new builder with the selected options
if options.branch:
diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
index 734d90b..e92e4f8 100755
--- a/tools/genboardscfg.py
+++ b/tools/genboardscfg.py
@@ -36,7 +36,7 @@ COMMENT_BLOCK = '''#
# List of boards
# Automatically generated by %s: don't edit
#
-# Status, Arch, CPU(:SPLCPU), SoC, Vendor, Board, Target, Options, Maintainers
+# Status, Arch, CPU, SoC, Vendor, Board, Target, Options, Maintainers
''' % __file__
@@ -58,8 +58,6 @@ def get_terminal_columns():
try:
ret = fcntl.ioctl(sys.stdout.fileno(), termios.TIOCGWINSZ, arg)
except IOError as exception:
- if exception.errno != errno.ENOTTY:
- raise
# If 'Inappropriate ioctl for device' error occurs,
# stdout is probably redirected. Return 0.
return 0
@@ -77,16 +75,14 @@ def check_top_directory():
"""Exit if we are not at the top of source directory."""
for f in ('README', 'Licenses'):
if not os.path.exists(f):
- print >> sys.stderr, 'Please run at the top of source directory.'
- sys.exit(1)
+ sys.exit('Please run at the top of source directory.')
def get_make_cmd():
"""Get the command name of GNU Make."""
process = subprocess.Popen([SHOW_GNU_MAKE], stdout=subprocess.PIPE)
ret = process.communicate()
if process.returncode:
- print >> sys.stderr, 'GNU Make not found'
- sys.exit(1)
+ sys.exit('GNU Make not found')
return ret[0].rstrip()
### classes ###
@@ -209,16 +205,12 @@ class DotConfigParser:
# sanity check of '.config' file
for field in self.must_fields:
if not field in fields:
- print >> sys.stderr, 'Error: %s is not defined in %s' % \
- (field, defconfig)
- sys.exit(1)
+ sys.exit('Error: %s is not defined in %s' % (field, defconfig))
- # fix-up for aarch64 and tegra
+ # fix-up for aarch64
if fields['arch'] == 'arm' and 'cpu' in fields:
if fields['cpu'] == 'armv8':
fields['arch'] = 'aarch64'
- if 'soc' in fields and re.match('tegra[0-9]*$', fields['soc']):
- fields['cpu'] += ':arm720t'
target, match, rear = defconfig.partition('_defconfig')
assert match and not rear, \
@@ -408,7 +400,7 @@ def __gen_boards_cfg(jobs):
jobs: The number of jobs to run simultaneously
Note:
- The incomplete boards.cfg is left over when an error (including
+ The incomplete boards.cfg is left over when an error (including
the termination by the keyboard interrupt) occurs on the halfway.
"""
check_top_directory()
@@ -455,8 +447,7 @@ def __gen_boards_cfg(jobs):
# wait until the reformat tool finishes
reformat_process.communicate()
if reformat_process.returncode != 0:
- print >> sys.stderr, '"%s" failed' % REFORMAT_CMD[0]
- sys.exit(1)
+ sys.exit('"%s" failed' % REFORMAT_CMD[0])
def gen_boards_cfg(jobs):
"""Generate boards.cfg file.
@@ -489,8 +480,7 @@ def main():
try:
jobs = int(options.jobs)
except ValueError:
- print >> sys.stderr, 'Option -j (--jobs) takes a number'
- sys.exit(1)
+ sys.exit('Option -j (--jobs) takes a number')
else:
try:
jobs = int(subprocess.Popen(['getconf', '_NPROCESSORS_ONLN'],
diff --git a/tools/patman/checkpatch.py b/tools/patman/checkpatch.py
index 0d4e935..34a3bd2 100644
--- a/tools/patman/checkpatch.py
+++ b/tools/patman/checkpatch.py
@@ -34,9 +34,8 @@ def FindCheckPatch():
return fname
path = os.path.dirname(path)
- print >> sys.stderr, ('Cannot find checkpatch.pl - please put it in your ' +
- '~/bin directory or use --no-check')
- sys.exit(1)
+ sys.exit('Cannot find checkpatch.pl - please put it in your ' +
+ '~/bin directory or use --no-check')
def CheckPatch(fname, verbose=False):
"""Run checkpatch.pl on a file.
diff --git a/tools/patman/patman.py b/tools/patman/patman.py
index c60aa5a..ca34cb9 100755
--- a/tools/patman/patman.py
+++ b/tools/patman/patman.py
@@ -58,7 +58,7 @@ parser.add_option('--no-check', action='store_false', dest='check_patch',
parser.add_option('--no-tags', action='store_false', dest='process_tags',
default=True, help="Don't process subject tags as aliaes")
-parser.usage = """patman [options]
+parser.usage += """
Create patches from commits in a branch, check them and email them as
specified by tags you place in the commits. Use -n to do a dry run first."""
@@ -122,8 +122,7 @@ else:
col = terminal.Color()
if not options.count:
str = 'No commits found to process - please use -c flag'
- print col.Color(col.RED, str)
- sys.exit(1)
+ sys.exit(col.Color(col.RED, str))
# Read the metadata from the commits
if options.count: