summaryrefslogtreecommitdiff
path: root/conf/amend-recipes.inc
diff options
context:
space:
mode:
authorSergey Lapin <slapin@ossfans.org>2010-01-22 00:50:27 +0300
committerSergey Lapin <slapin@ossfans.org>2010-01-22 00:50:27 +0300
commit029e21c8111deafa850ad1724e48da29c321f2f8 (patch)
tree00c9ad7db155d3f3fe471517d5d882b517f9ccfd /conf/amend-recipes.inc
parent8e099432e6b3687bc97f756aa7176b02cb1c7693 (diff)
parentb6f9a84fd99c89ac074aaed90cdd3d064c534492 (diff)
Merge branch 'org.openembedded.dev' of git@git.openembedded.net:openembedded into org.openembedded.dev
Diffstat (limited to 'conf/amend-recipes.inc')
-rw-r--r--conf/amend-recipes.inc29
1 files changed, 29 insertions, 0 deletions
diff --git a/conf/amend-recipes.inc b/conf/amend-recipes.inc
new file mode 100644
index 0000000000..bcb93d4e75
--- /dev/null
+++ b/conf/amend-recipes.inc
@@ -0,0 +1,29 @@
+# Allows tweaks to be amended to a recipe via a .inc in its FILESPATH
+#
+# Simply drop amend.inc into an appropriate place in a recipe's FILESPATH and
+# it'll be parsed in after the recipe itself is.
+#
+# Copyright (c) 2009 MontaVista Software, Inc. All rights reserved.
+#
+# Released under the MIT license (see LICENSE.MIT for the terms)
+
+python () {
+ import bb, os
+
+ filespath = d.getVar("FILESPATH", 1).split(":")
+ amendfiles = [os.path.join(fpath, "amend.inc")
+ for fpath in filespath]
+
+ # Adding all amend.incs that can exist to the __depends, to ensure that
+ # creating one of them invalidates the bitbake cache. Note that it
+ # requires a fix in bitbake. Without the bitbake fix, the cache will be
+ # completely invalidated on every bitbake execution.
+ depends = d.getVar("__depends", 0) or []
+ d.setVar("__depends", depends + [(file, 0) for file in amendfiles if not os.path.exists(file)])
+
+ existing = (file for file in amendfiles if os.path.exists(file))
+ try:
+ bb.parse.handle(existing.next(), d, 1)
+ except StopIteration:
+ pass
+}