All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] buildman: Allow using older versions of genboardscfg.py
@ 2020-07-19 15:59 Simon Glass
  2020-07-28 18:58 ` Simon Glass
  0 siblings, 1 reply; 2+ messages in thread
From: Simon Glass @ 2020-07-19 15:59 UTC (permalink / raw)
  To: u-boot

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>
---

 tools/buildman/control.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/tools/buildman/control.py b/tools/buildman/control.py
index 969d866547..838d98a37b 100644
--- a/tools/buildman/control.py
+++ b/tools/buildman/control.py
@@ -203,10 +203,16 @@ 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')
-        genboardscfg = os.path.join(options.git, 'tools/genboardscfg.py')
+        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:
-            sys.exit("Failed to generate boards.cfg")
+            # Older versions don't support -q
+            status = subprocess.call([genboardscfg, '-o', board_file])
+            if status != 0:
+                sys.exit("Failed to generate boards.cfg")
 
         boards = board.Boards()
         boards.ReadBoards(board_file)
-- 
2.28.0.rc0.105.gf9edc3c819-goog

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* [PATCH] buildman: Allow using older versions of genboardscfg.py
  2020-07-19 15:59 [PATCH] buildman: Allow using older versions of genboardscfg.py Simon Glass
@ 2020-07-28 18:58 ` Simon Glass
  0 siblings, 0 replies; 2+ messages in thread
From: Simon Glass @ 2020-07-28 18:58 UTC (permalink / raw)
  To: u-boot

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>
---

 tools/buildman/control.py | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

Applied to u-boot-dm, thanks!

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-07-28 18:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-07-19 15:59 [PATCH] buildman: Allow using older versions of genboardscfg.py Simon Glass
2020-07-28 18:58 ` Simon Glass

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.