[bitbake-devel] [PATCH v2] bitbake/lib/bb/cookerdata.py: Check if layer conf files exist before parsing them
Humberto Ibarra
humberto.ibarra.lopez at intel.com
Wed May 11 20:01:08 UTC 2016
If an invalid layer is added to bblayers.conf, the parsing of said file
ends with a trace and an "Unable to parse" exception. This is not the
ideal output, especially considering that we know exactly why this is failing.
This patch checks if a layer conf file exists before trying to parse it.
If it does not, a clear and more concise message is send to the user.
Otherwise, the parsing continues.
[Yocto #9506]
Signed-off-by: Humberto Ibarra <humberto.ibarra.lopez at intel.com>
---
bitbake/lib/bb/cookerdata.py | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/bitbake/lib/bb/cookerdata.py b/bitbake/lib/bb/cookerdata.py
index 50259a9..a1b0457 100644
--- a/bitbake/lib/bb/cookerdata.py
+++ b/bitbake/lib/bb/cookerdata.py
@@ -178,9 +178,13 @@ def catch_parse_error(func):
try:
return func(fn, *args)
except IOError as exc:
- import traceback
- parselog.critical(traceback.format_exc())
- parselog.critical("Unable to parse %s: %s" % (fn, exc))
+ import errno
+ if exc.errno == errno.ENOENT:
+ parselog.critical("Unable to find the configuration file: %s" % fn)
+ else:
+ import traceback
+ parselog.critical(traceback.format_exc())
+ parselog.critical("Unable to parse %s: %s" % (fn, exc))
sys.exit(1)
except bb.data_smart.ExpansionError as exc:
import traceback
--
2.4.11
More information about the bitbake-devel
mailing list