1 # Allows tweaks to be amended to a recipe via a .inc in its FILESPATH
3 # Simply drop amend.inc into an appropriate place in a recipe's FILESPATH and
4 # it'll be parsed in after the recipe itself is.
6 # Copyright (c) 2009 MontaVista Software, Inc. All rights reserved.
8 # Released under the MIT license (see LICENSE.MIT for the terms)
13 filespath = d.getVar("FILESPATH", 1).split(":")
14 amendfiles = [os.path.join(fpath, "amend.inc")
15 for fpath in filespath]
17 # Adding all amend.incs that can exist to the __depends, to ensure that
18 # creating one of them invalidates the bitbake cache. Note that it
19 # requires a fix in bitbake. Without the bitbake fix, the cache will be
20 # completely invalidated on every bitbake execution.
21 depends = d.getVar("__depends", 0) or []
22 d.setVar("__depends", depends + [(file, 0) for file in amendfiles if not os.path.exists(file)])
24 # Make sure we don't parse the same amend.inc file more than once, if
25 # there are duplicates in FILESPATH
28 for file in amendfiles:
29 if os.path.exists(file):
31 bb.parse.handle(file, d, 1)