bitbake: parse: Return IOError when including file with absolute path
authorMartin Jansa <martin.jansa@gmail.com>
Fri, 23 Aug 2013 17:06:26 +0000 (19:06 +0200)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 26 Aug 2013 10:29:46 +0000 (11:29 +0100)
commit85df3f55b9573499017da4816d305b431ccecd84
tree9067985a1b27fccfc2ffb57b2fb89ad708d651f8
parent0c8b63b161dec0bf751be572b2c481a4e98fb424
bitbake: parse: Return IOError when including file with absolute path

* resolve_file was behaving different when relative and absolute
  paths were passed to it

* include relative-path/non-existent-file.inc
  works correctly resolve_file throws IOError, BBHandler.py:handle()
  doesn't catch it, ConfHandler.py:include() catches IOError and shows:
  DEBUG: CONF file 'relative-path/non-existent-file.inc' not found
* include /absolute-path/non-existent-file.inc
  was failing, because resolve_file just returns fn,
  BBHandler.py:handle() calls bb.parse.mark_dependency(d, abs_fn)
  which throws:
  OSError: [Errno 2] No such file or directory: '/absolute-path/non-existent-file.inc'
  and parsing fails.
  Ad isfile() test for absolute fn and throw IOError to make
  resolve_file behavior consistent for both paths.

* I know we had some issues with -b relative-path-to-recipe.bb and
  absolute path, so consider this patch only as RFC and documentation of
  this problem

* Catch OSError too in ConfHandler.py:include() e.g. in case the file exists, but user
  cannot read it or something like that.

(Bitbake rev: b0bbd89a4f0b98fa1ab28b8e0526cd9ddb76fa57)

Signed-off-by: Martin Jansa <Martin.Jansa@gmail.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
bitbake/lib/bb/parse/__init__.py
bitbake/lib/bb/parse/parse_py/ConfHandler.py