summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/__init__.py
diff options
context:
space:
mode:
authorChristopher Larson <chris_larson@mentor.com>2015-07-31 11:16:46 -0700
committerRichard Purdie <richard.purdie@linuxfoundation.org>2015-08-01 22:24:20 +0100
commit22078d5e533e59a9aa6999abefbf6ece4e01de8d (patch)
treee0c99f600700dcc743c3d6b3c3ff5c7198910bab /bitbake/lib/bb/parse/__init__.py
parent75fc6bf0a02dd0512a958cf0c1461f4e98796736 (diff)
downloadpoky-22078d5e533e59a9aa6999abefbf6ece4e01de8d.tar.gz
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 <chris_larson@mentor.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/lib/bb/parse/__init__.py')
-rw-r--r--bitbake/lib/bb/parse/__init__.py7
1 files changed, 4 insertions, 3 deletions
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.
26 26
27handlers = [] 27handlers = []
28 28
29import errno
30import logging
29import os 31import os
30import stat 32import stat
31import logging
32import bb 33import bb
33import bb.utils 34import bb.utils
34import bb.siggen 35import bb.siggen
@@ -122,12 +123,12 @@ def resolve_file(fn, d):
122 for af in attempts: 123 for af in attempts:
123 mark_dependency(d, af) 124 mark_dependency(d, af)
124 if not newfn: 125 if not newfn:
125 raise IOError("file %s not found in %s" % (fn, bbpath)) 126 raise IOError(errno.ENOENT, "file %s not found in %s" % (fn, bbpath))
126 fn = newfn 127 fn = newfn
127 128
128 mark_dependency(d, fn) 129 mark_dependency(d, fn)
129 if not os.path.isfile(fn): 130 if not os.path.isfile(fn):
130 raise IOError("file %s not found" % fn) 131 raise IOError(errno.ENOENT, "file %s not found" % fn)
131 132
132 return fn 133 return fn
133 134