summaryrefslogtreecommitdiffstats
path: root/bitbake/lib/bb/parse/__init__.py
diff options
context:
space:
mode:
Diffstat (limited to 'bitbake/lib/bb/parse/__init__.py')
-rw-r--r--bitbake/lib/bb/parse/__init__.py19
1 files changed, 15 insertions, 4 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py
index c973f6fdbf..97983c9880 100644
--- a/bitbake/lib/bb/parse/__init__.py
+++ b/bitbake/lib/bb/parse/__init__.py
@@ -73,9 +73,17 @@ def update_mtime(f):
73def mark_dependency(d, f): 73def mark_dependency(d, f):
74 if f.startswith('./'): 74 if f.startswith('./'):
75 f = "%s/%s" % (os.getcwd(), f[2:]) 75 f = "%s/%s" % (os.getcwd(), f[2:])
76 deps = (d.getVar('__depends') or []) + [(f, cached_mtime(f))] 76 deps = (d.getVar('__depends') or [])
77 d.setVar('__depends', deps) 77 s = (f, cached_mtime_noerror(f))
78 78 if s not in deps:
79 deps.append(s)
80 d.setVar('__depends', deps)
81
82def check_dependency(d, f):
83 s = (f, cached_mtime_noerror(f))
84 deps = (d.getVar('__depends') or [])
85 return s in deps
86
79def supports(fn, data): 87def supports(fn, data):
80 """Returns true if we have a handler for this file, false otherwise""" 88 """Returns true if we have a handler for this file, false otherwise"""
81 for h in handlers: 89 for h in handlers:
@@ -102,11 +110,14 @@ def init_parser(d):
102def resolve_file(fn, d): 110def resolve_file(fn, d):
103 if not os.path.isabs(fn): 111 if not os.path.isabs(fn):
104 bbpath = d.getVar("BBPATH", True) 112 bbpath = d.getVar("BBPATH", True)
105 newfn = bb.utils.which(bbpath, fn) 113 newfn, attempts = bb.utils.which(bbpath, fn, history=True)
114 for af in attempts:
115 mark_dependency(d, af)
106 if not newfn: 116 if not newfn:
107 raise IOError("file %s not found in %s" % (fn, bbpath)) 117 raise IOError("file %s not found in %s" % (fn, bbpath))
108 fn = newfn 118 fn = newfn
109 119
120 mark_dependency(d, fn)
110 if not os.path.isfile(fn): 121 if not os.path.isfile(fn):
111 raise IOError("file %s not found" % fn) 122 raise IOError("file %s not found" % fn)
112 123