1
0
mirror of https://xff.cz/git/u-boot/ synced 2025-08-31 16:22:36 +02:00

buildman: Allow using older versions of genboardscfg.py

Older versions of this script don't support the -q flag. Since buildman
runs this script from when it starts, we may get the old version.

Fix this in two ways:

1. Use the version from the same tree as buildman is run from, if
available
2. Failing that, allow the -q flag to be missing

Signed-off-by: Simon Glass <sjg@chromium.org>
This commit is contained in:
Simon Glass
2020-07-19 09:59:49 -06:00
parent 56c31e5e50
commit 5a910b92bc

View File

@@ -185,8 +185,14 @@ def DoBuildman(options, args, toolchains=None, make_func=None, boards=None,
if not os.path.exists(options.output_dir):
os.makedirs(options.output_dir)
board_file = os.path.join(options.output_dir, 'boards.cfg')
our_path = os.path.dirname(os.path.realpath(__file__))
genboardscfg = os.path.join(our_path, '../genboardscfg.py')
if not os.path.exists(genboardscfg):
genboardscfg = os.path.join(options.git, 'tools/genboardscfg.py')
status = subprocess.call([genboardscfg, '-q', '-o', board_file])
if status != 0:
# Older versions don't support -q
status = subprocess.call([genboardscfg, '-o', board_file])
if status != 0:
sys.exit("Failed to generate boards.cfg")