buildman: Rename the main module
authorSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2020 00:08:56 +0000 (18:08 -0600)
committerSimon Glass <sjg@chromium.org>
Sun, 26 Apr 2020 20:25:21 +0000 (14:25 -0600)
Python does not like the module name being the same as the module
directory. To allow buildman modules to be used from other tools, rename
it.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/buildman
tools/buildman/buildman.py [deleted file]
tools/buildman/main.py [new file with mode: 0755]

index e4fba2d4b03b785f50033c817bba292f0c8ee960..11a5d8e18ab71465be9424cf930c5e792c75edb7 120000 (symlink)
@@ -1 +1 @@
-buildman.py
\ No newline at end of file
+main.py
\ No newline at end of file
diff --git a/tools/buildman/buildman.py b/tools/buildman/buildman.py
deleted file mode 100755 (executable)
index 0add628..0000000
+++ /dev/null
@@ -1,66 +0,0 @@
-#!/usr/bin/env python3
-# SPDX-License-Identifier: GPL-2.0+
-#
-# Copyright (c) 2012 The Chromium OS Authors.
-#
-
-"""See README for more information"""
-
-import multiprocessing
-import os
-import re
-import sys
-import unittest
-
-# Bring in the patman libraries
-our_path = os.path.dirname(os.path.realpath(__file__))
-sys.path.insert(1, os.path.join(our_path, '../patman'))
-
-# Our modules
-import board
-import bsettings
-import builder
-import checkpatch
-import cmdline
-import control
-import doctest
-import gitutil
-import patchstream
-import terminal
-import toolchain
-
-def RunTests(skip_net_tests):
-    import func_test
-    import test
-    import doctest
-
-    result = unittest.TestResult()
-    for module in ['toolchain', 'gitutil']:
-        suite = doctest.DocTestSuite(module)
-        suite.run(result)
-
-    sys.argv = [sys.argv[0]]
-    if skip_net_tests:
-        test.use_network = False
-    for module in (test.TestBuild, func_test.TestFunctional):
-        suite = unittest.TestLoader().loadTestsFromTestCase(module)
-        suite.run(result)
-
-    print(result)
-    for test, err in result.errors:
-        print(err)
-    for test, err in result.failures:
-        print(err)
-
-
-options, args = cmdline.ParseArgs()
-
-# Run our meagre tests
-if options.test:
-    RunTests(options.skip_net_tests)
-
-# Build selected commits for selected boards
-else:
-    bsettings.Setup(options.config_file)
-    ret_code = control.DoBuildman(options, args)
-    sys.exit(ret_code)
diff --git a/tools/buildman/main.py b/tools/buildman/main.py
new file mode 100755 (executable)
index 0000000..0add628
--- /dev/null
@@ -0,0 +1,66 @@
+#!/usr/bin/env python3
+# SPDX-License-Identifier: GPL-2.0+
+#
+# Copyright (c) 2012 The Chromium OS Authors.
+#
+
+"""See README for more information"""
+
+import multiprocessing
+import os
+import re
+import sys
+import unittest
+
+# Bring in the patman libraries
+our_path = os.path.dirname(os.path.realpath(__file__))
+sys.path.insert(1, os.path.join(our_path, '../patman'))
+
+# Our modules
+import board
+import bsettings
+import builder
+import checkpatch
+import cmdline
+import control
+import doctest
+import gitutil
+import patchstream
+import terminal
+import toolchain
+
+def RunTests(skip_net_tests):
+    import func_test
+    import test
+    import doctest
+
+    result = unittest.TestResult()
+    for module in ['toolchain', 'gitutil']:
+        suite = doctest.DocTestSuite(module)
+        suite.run(result)
+
+    sys.argv = [sys.argv[0]]
+    if skip_net_tests:
+        test.use_network = False
+    for module in (test.TestBuild, func_test.TestFunctional):
+        suite = unittest.TestLoader().loadTestsFromTestCase(module)
+        suite.run(result)
+
+    print(result)
+    for test, err in result.errors:
+        print(err)
+    for test, err in result.failures:
+        print(err)
+
+
+options, args = cmdline.ParseArgs()
+
+# Run our meagre tests
+if options.test:
+    RunTests(options.skip_net_tests)
+
+# Build selected commits for selected boards
+else:
+    bsettings.Setup(options.config_file)
+    ret_code = control.DoBuildman(options, args)
+    sys.exit(ret_code)