From 22078d5e533e59a9aa6999abefbf6ece4e01de8d Mon Sep 17 00:00:00 2001 From: Christopher Larson Date: Fri, 31 Jul 2015 11:16:46 -0700 Subject: bitbake: bb.parse: properly error out on filesystem errors We've had a long-standing bug where a legitimate error reading a file (IOError or OSError) is always suppressed as though it was a 'file not found' case. As a concrete example, if you do a `chmod 000 conf/local.conf`, it'll silently not parse local.conf, rather than erroring to let the user know about the problem. Fix this by handling the ENOENT case specifically. (Bitbake rev: e691312a3add222b04e7b2f52f8df6abcb9068bf) Signed-off-by: Christopher Larson Signed-off-by: Richard Purdie --- bitbake/lib/bb/parse/__init__.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'bitbake/lib/bb/parse/__init__.py') diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 4a78e183ab..1becaa4f02 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py @@ -26,9 +26,10 @@ File parsers for the BitBake build tools. handlers = [] +import errno +import logging import os import stat -import logging import bb import bb.utils import bb.siggen @@ -122,12 +123,12 @@ def resolve_file(fn, d): for af in attempts: mark_dependency(d, af) if not newfn: - raise IOError("file %s not found in %s" % (fn, bbpath)) + raise IOError(errno.ENOENT, "file %s not found in %s" % (fn, bbpath)) fn = newfn mark_dependency(d, fn) if not os.path.isfile(fn): - raise IOError("file %s not found" % fn) + raise IOError(errno.ENOENT, "file %s not found" % fn) return fn -- cgit v1.2.3-54-g00ecf