Update drivers
[vuplus_openembedded] / classes / amend.bbclass
1 # Allows tweaks to be amended to a recipe via a .inc in its FILESPATH
2 #
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.
5 #
6 # Copyright (c) 2009 MontaVista Software, Inc.  All rights reserved.
7 #
8 # Released under the MIT license (see LICENSE.MIT for the terms)
9
10 python () {
11     import bb, os
12
13     filespath = d.getVar("FILESPATH", 1).split(":")
14     amendfiles = [os.path.join(fpath, "amend.inc")
15                   for fpath in filespath]
16
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)])
23
24     existing = (file for file in amendfiles if os.path.exists(file))
25     try:
26         bb.parse.handle(existing.next(), d, 1)
27     except StopIteration:
28         pass
29 }