[bitbake-devel,1/1] cooker: simplify BB_DANGLINGAPPENDS_WARNONLY

Submitted by Robert Yang on Nov. 30, 2018, 3:39 a.m. | Patch ID: 156761

Details

Message ID 7a0dc7e0666fb0c07ea7dd49f5c0aa5eb06ff87a.1543548740.git.liezhi.yang@windriver.com
State New
Headers show

Commit Message

Robert Yang Nov. 30, 2018, 3:39 a.m.
- d.getVar('BB_DANGLINGAPPENDS_WARNONLY', False) -> d.getVar('BB_DANGLINGAPPENDS_WARNONLY')
  There is no reason to use 'False'.

- Use bb.utils.to_boolean for warn_only.

Signed-off-by: Robert Yang <liezhi.yang@windriver.com>
---
 bitbake/lib/bb/cooker.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Patch hide | download patch | download mbox

diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py
index 16681ba..28a16c5 100644
--- a/bitbake/lib/bb/cooker.py
+++ b/bitbake/lib/bb/cooker.py
@@ -928,9 +928,8 @@  class BBCooker:
 
         if appends_without_recipes:
             msg = 'No recipes available for:\n  %s' % '\n  '.join(appends_without_recipes)
-            warn_only = self.data.getVar("BB_DANGLINGAPPENDS_WARNONLY", \
-                 False) or "no"
-            if warn_only.lower() in ("1", "yes", "true"):
+            warn_only = self.data.getVar("BB_DANGLINGAPPENDS_WARNONLY")
+            if bb.utils.to_boolean(warn_only):
                 bb.warn(msg)
             else:
                 bb.fatal(msg)