]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
buildman: Move to absolute imports
authorSimon Glass <sjg@chromium.org>
Sat, 18 Apr 2020 00:09:02 +0000 (18:09 -0600)
committerSimon Glass <sjg@chromium.org>
Sun, 26 Apr 2020 20:25:21 +0000 (14:25 -0600)
At present buildman sets the python path on startup so that it can access
the libraries it needs. If we convert to use absolute imports this is not
necessary.

Move buildman to use absolute imports. Also adjust moveconfig.py too since
it uses some buildman modules and cannot work without this.

Signed-off-by: Simon Glass <sjg@chromium.org>
tools/buildman/builder.py
tools/buildman/control.py
tools/buildman/func_test.py
tools/buildman/main.py
tools/buildman/test.py
tools/buildman/toolchain.py
tools/moveconfig.py

index 1b61e3a837ef1082d56a0a5e770b45239424e503..b7f2c426e3a8f8d10f0da0f90a06a7ccb4dd9eb4 100644 (file)
@@ -17,12 +17,12 @@ import sys
 import threading
 import time
 
-import builderthread
+from buildman import builderthread
+from buildman import toolchain
 import command
 import gitutil
 import terminal
 from terminal import Print
-import toolchain
 
 """
 Theory of Operation
index 7c8d7520fbde8ddadb11d6c6f4f9d8ddc068b6ea..e05234c08f720b3bb9ab71884c8daed0a88ea7a1 100644 (file)
@@ -5,18 +5,18 @@
 import multiprocessing
 import os
 import shutil
+import subprocess
 import sys
 
-import board
-import bsettings
-from builder import Builder
+from buildman import board
+from buildman import bsettings
+from buildman import toolchain
+from buildman.builder import Builder
+import command
 import gitutil
 import patchstream
 import terminal
 from terminal import Print
-import toolchain
-import command
-import subprocess
 
 def GetPlural(count):
     """Returns a plural 's' if count is not 1"""
index 29b28f5a9f90dc4e4dd64bbb68ca74ef6e7ee928..9bfdd536985b2f13d8eb3314e480f8c47a4cb931 100644 (file)
@@ -8,11 +8,12 @@ import sys
 import tempfile
 import unittest
 
-import board
-import bsettings
-import cmdline
+from buildman import board
+from buildman import bsettings
+from buildman import cmdline
+from buildman import control
+from buildman import toolchain
 import command
-import control
 import gitutil
 import terminal
 import toolchain
index 0add628a636f2d34e6fe6df2afd0d7496ee1ebe2..94d495c40b8566d6fbce071de52c63949e992bd7 100755 (executable)
@@ -6,6 +6,7 @@
 
 """See README for more information"""
 
+import doctest
 import multiprocessing
 import os
 import re
@@ -14,20 +15,19 @@ 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'))
+sys.path.insert(1, os.path.join(our_path, '..'))
+sys.path.insert(2, os.path.join(our_path, '../patman'))
 
 # Our modules
-import board
-import bsettings
-import builder
-import checkpatch
-import cmdline
-import control
-import doctest
-import gitutil
+from buildman import board
+from buildman import bsettings
+from buildman import builder
+from buildman import cmdline
+from buildman import control
+from buildman import toolchain
 import patchstream
+import gitutil
 import terminal
-import toolchain
 
 def RunTests(skip_net_tests):
     import func_test
index 8b6d138f705ae7e6ce71d5eb5603098e0775a059..87175eeb63bd9bb847172f3c4a8fdb6a002fa756 100644 (file)
@@ -13,15 +13,15 @@ import unittest
 our_path = os.path.dirname(os.path.realpath(__file__))
 sys.path.append(os.path.join(our_path, '../patman'))
 
-import board
-import bsettings
-import builder
-import control
-import command
+from buildman import board
+from buildman import bsettings
+from buildman import builder
+from buildman import control
+from buildman import toolchain
 import commit
+import command
 import terminal
 import test_util
-import toolchain
 import tools
 
 use_network = True
index 4456a805c742d0505500f8c5ea27803f794d660a..a3540491ec55365ec567b64529b6977319c18a71 100644 (file)
@@ -10,7 +10,7 @@ import sys
 import tempfile
 import urllib.request, urllib.error, urllib.parse
 
-import bsettings
+from buildman import bsettings
 import command
 import terminal
 import tools
index d8bf7fd0717fe1c405317e9e5ea95698a50ecefc..0dd8670403ca6387196597bdc889d50b31e07319 100755 (executable)
@@ -314,11 +314,11 @@ import tempfile
 import threading
 import time
 
-sys.path.append(os.path.join(os.path.dirname(__file__), 'buildman'))
+sys.path.append(os.path.join(os.path.dirname(__file__), '..'))
 sys.path.append(os.path.join(os.path.dirname(__file__), 'patman'))
-import bsettings
-import kconfiglib
-import toolchain
+from buildman import bsettings
+from buildman import kconfiglib
+from buildman import toolchain
 
 SHOW_GNU_MAKE = 'scripts/show-gnu-make'
 SLEEP_TIME=0.03