diff options
Diffstat (limited to 'bitbake/lib/bb/parse/__init__.py')
-rw-r--r-- | bitbake/lib/bb/parse/__init__.py | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/bitbake/lib/bb/parse/__init__.py b/bitbake/lib/bb/parse/__init__.py index 7ffdaa6fd7..d428d8a4b4 100644 --- a/bitbake/lib/bb/parse/__init__.py +++ b/bitbake/lib/bb/parse/__init__.py | |||
@@ -176,4 +176,41 @@ def get_file_depends(d): | |||
176 | dep_files.append(os.path.abspath(fn)) | 176 | dep_files.append(os.path.abspath(fn)) |
177 | return " ".join(dep_files) | 177 | return " ".join(dep_files) |
178 | 178 | ||
179 | def vardeps(*varnames): | ||
180 | """ | ||
181 | Function decorator that can be used to instruct the bitbake dependency | ||
182 | parsing to add a dependency on the specified variables names | ||
183 | |||
184 | Example: | ||
185 | |||
186 | @bb.parse.vardeps("FOO", "BAR") | ||
187 | def my_function(): | ||
188 | ... | ||
189 | |||
190 | """ | ||
191 | def inner(f): | ||
192 | if not hasattr(f, "bb_vardeps"): | ||
193 | f.bb_vardeps = set() | ||
194 | f.bb_vardeps |= set(varnames) | ||
195 | return f | ||
196 | return inner | ||
197 | |||
198 | def vardepsexclude(*varnames): | ||
199 | """ | ||
200 | Function decorator that can be used to instruct the bitbake dependency | ||
201 | parsing to ignore dependencies on the specified variable names in the code | ||
202 | |||
203 | Example: | ||
204 | |||
205 | @bb.parse.vardepsexclude("FOO", "BAR") | ||
206 | def my_function(): | ||
207 | ... | ||
208 | """ | ||
209 | def inner(f): | ||
210 | if not hasattr(f, "bb_vardepsexclude"): | ||
211 | f.bb_vardepsexclude = set() | ||
212 | f.bb_vardepsexclude |= set(varnames) | ||
213 | return f | ||
214 | return inner | ||
215 | |||
179 | from bb.parse.parse_py import __version__, ConfHandler, BBHandler | 216 | from bb.parse.parse_py import __version__, ConfHandler, BBHandler |