diff mbox

[U-Boot,v3,3/7] tools/genboardscfg.py: be tolerant of insane Kconfig

Message ID 1408937988-19923-4-git-send-email-yamada.m@jp.panasonic.com
State Accepted
Delegated to: Tom Rini
Headers show

Commit Message

Masahiro Yamada Aug. 25, 2014, 3:39 a.m. UTC
The tools/genboardscfg.py expects all the Kconfig and defconfig are
written correctly.  Imagine someone accidentally has broken a board.
Error-out just for one broken board is annoying for the other
developers.  Let the tool skip insane boards and continue processing.

Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
Acked-by: Simon Glass <sjg@chromium.org>
---

Changes in v3: None
Changes in v2: None

 tools/genboardscfg.py | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

Comments

Tom Rini Aug. 29, 2014, 2:41 p.m. UTC | #1
On Mon, Aug 25, 2014 at 12:39:44PM +0900, Masahiro Yamada wrote:

> The tools/genboardscfg.py expects all the Kconfig and defconfig are
> written correctly.  Imagine someone accidentally has broken a board.
> Error-out just for one broken board is annoying for the other
> developers.  Let the tool skip insane boards and continue processing.
> 
> Signed-off-by: Masahiro Yamada <yamada.m@jp.panasonic.com>
> Acked-by: Simon Glass <sjg@chromium.org>

Applied to u-boot/master, thanks!
diff mbox

Patch

diff --git a/tools/genboardscfg.py b/tools/genboardscfg.py
index 2ff2dbd..722b316 100755
--- a/tools/genboardscfg.py
+++ b/tools/genboardscfg.py
@@ -215,7 +215,10 @@  class DotConfigParser:
         # sanity check of '.config' file
         for field in self.must_fields:
             if not field in fields:
-                sys.exit('Error: %s is not defined in %s' % (field, defconfig))
+                print >> sys.stderr, (
+                    "WARNING: '%s' is not defined in '%s'. Skip." %
+                    (field, defconfig))
+                return
 
         # fix-up for aarch64
         if fields['arch'] == 'arm' and 'cpu' in fields:
@@ -307,7 +310,11 @@  class Slot:
             return True
         if self.ps.poll() == None:
             return False
-        self.parser.parse(self.defconfig)
+        if self.ps.poll() == 0:
+            self.parser.parse(self.defconfig)
+        else:
+            print >> sys.stderr, ("WARNING: failed to process '%s'. skip." %
+                                  self.defconfig)
         self.occupied = False
         return True