mirror of
https://git.yoctoproject.org/poky
synced 2026-05-30 12:29:55 +00:00
bitbake: ConfHandler: Rename oldfn to parentfn to be clearer
Looking at this function I had no idea what oldfn was, I doubt anyone else would either without looking up what the caller does. "parentfn" would seem a more appropriate name so rename it. (Bitbake rev: fc70ed596703a1aa954223b169d4ad51193a6ec1) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
@@ -66,21 +66,21 @@ def init(data):
|
|||||||
def supports(fn, d):
|
def supports(fn, d):
|
||||||
return fn[-5:] == ".conf"
|
return fn[-5:] == ".conf"
|
||||||
|
|
||||||
def include(oldfn, fn, lineno, data, error_out):
|
def include(parentfn, fn, lineno, data, error_out):
|
||||||
"""
|
"""
|
||||||
error_out: A string indicating the verb (e.g. "include", "inherit") to be
|
error_out: A string indicating the verb (e.g. "include", "inherit") to be
|
||||||
used in a ParseError that will be raised if the file to be included could
|
used in a ParseError that will be raised if the file to be included could
|
||||||
not be included. Specify False to avoid raising an error in this case.
|
not be included. Specify False to avoid raising an error in this case.
|
||||||
"""
|
"""
|
||||||
if oldfn == fn: # prevent infinite recursion
|
if parentfn == fn: # prevent infinite recursion
|
||||||
return None
|
return None
|
||||||
|
|
||||||
import bb
|
import bb
|
||||||
fn = data.expand(fn)
|
fn = data.expand(fn)
|
||||||
oldfn = data.expand(oldfn)
|
parentfn = data.expand(parentfn)
|
||||||
|
|
||||||
if not os.path.isabs(fn):
|
if not os.path.isabs(fn):
|
||||||
dname = os.path.dirname(oldfn)
|
dname = os.path.dirname(parentfn)
|
||||||
bbpath = "%s:%s" % (dname, data.getVar("BBPATH", True))
|
bbpath = "%s:%s" % (dname, data.getVar("BBPATH", True))
|
||||||
abs_fn, attempts = bb.utils.which(bbpath, fn, history=True)
|
abs_fn, attempts = bb.utils.which(bbpath, fn, history=True)
|
||||||
if abs_fn and bb.parse.check_dependency(data, abs_fn):
|
if abs_fn and bb.parse.check_dependency(data, abs_fn):
|
||||||
@@ -97,7 +97,7 @@ def include(oldfn, fn, lineno, data, error_out):
|
|||||||
ret = handle(fn, data, True)
|
ret = handle(fn, data, True)
|
||||||
except (IOError, OSError):
|
except (IOError, OSError):
|
||||||
if error_out:
|
if error_out:
|
||||||
raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), oldfn, lineno)
|
raise ParseError("Could not %(error_out)s file %(fn)s" % vars(), parentfn, lineno)
|
||||||
logger.debug(2, "CONF file '%s' not found", fn)
|
logger.debug(2, "CONF file '%s' not found", fn)
|
||||||
bb.parse.mark_dependency(data, fn)
|
bb.parse.mark_dependency(data, fn)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user