]> git.kernelconcepts.de Git - karo-tx-uboot.git/blobdiff - tools/buildman/control.py
buildman: Move full help code into the control module
[karo-tx-uboot.git] / tools / buildman / control.py
index 68ea961876ebde40f7b61bae85a150b7593ca7e7..408d9b126bb7a7d98e89bccc6923fd7f02d5833f 100644 (file)
@@ -84,6 +84,14 @@ def DoBuildman(options, args):
         options: Command line options object
         args: Command line arguments (list of strings)
     """
+    if options.full_help:
+        pager = os.getenv('PAGER')
+        if not pager:
+            pager = 'more'
+        fname = os.path.join(os.path.dirname(sys.argv[0]), 'README')
+        command.Run(pager, fname)
+        return 0
+
     gitutil.Setup()
 
     bsettings.Setup(options.config_file)
@@ -94,7 +102,7 @@ def DoBuildman(options, args):
     if options.list_tool_chains:
         toolchains.List()
         print
-        return
+        return 0
 
     # Work out how many commits to build. We want to build everything on the
     # branch. We also build the upstream commit as a control so we can see
@@ -127,7 +135,13 @@ def DoBuildman(options, args):
 
     boards = board.Boards()
     boards.ReadBoards(os.path.join(options.git, 'boards.cfg'))
-    why_selected = boards.SelectBoards(args)
+
+    exclude = []
+    if options.exclude:
+        for arg in options.exclude:
+            exclude += arg.split(',')
+
+    why_selected = boards.SelectBoards(args, exclude)
     selected = boards.GetSelected()
     if not len(selected):
         sys.exit(col.Color(col.RED, 'No matching boards found'))
@@ -210,12 +224,18 @@ def DoBuildman(options, args):
                                options)
 
         builder.SetDisplayOptions(options.show_errors, options.show_sizes,
-                                  options.show_detail, options.show_bloat)
+                                  options.show_detail, options.show_bloat,
+                                  options.list_error_boards)
         if options.summary:
             # We can't show function sizes without board details at present
             if options.show_bloat:
                 options.show_detail = True
             builder.ShowSummary(commits, board_selected)
         else:
-            builder.BuildBoards(commits, board_selected,
+            fail, warned = builder.BuildBoards(commits, board_selected,
                                 options.keep_outputs, options.verbose)
+            if fail:
+                return 128
+            elif warned:
+                return 129
+    return 0