[OE-core] [PATCH 02/23] buildhistory.bbclass: add BUILDHISTORY_FORCE_UPDATE option

Mikko Rapeli mikko.rapeli at bmw.de
Thu Jul 20 13:22:50 UTC 2017


Setting BUILDHISTORY_FORCE_UPDATE = "1" in local.conf forces buildhistory
updates and recipe rebuilds also when only buildhistory.bbclass changed.

This is handy when using sstate cache and modifying buildhistory to include
new data like recipe and package LICENSE fields.

By default new buildhistory data is updated when recipes are rebuild and
new fields like LICENSE are not deployed immediately.

Signed-off-by: Mikko Rapeli <mikko.rapeli at bmw.de>
---
 meta/classes/buildhistory.bbclass | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/meta/classes/buildhistory.bbclass b/meta/classes/buildhistory.bbclass
index cc3b144..bc3145e 100644
--- a/meta/classes/buildhistory.bbclass
+++ b/meta/classes/buildhistory.bbclass
@@ -42,10 +42,11 @@ BUILDHISTORY_COMMIT_AUTHOR ?= "buildhistory <buildhistory@${DISTRO}>"
 BUILDHISTORY_PUSH_REPO ?= ""
 
 SSTATEPOSTINSTFUNCS_append = " buildhistory_emit_pkghistory"
-# We want to avoid influencing the signatures of sstate tasks - first the function itself:
-sstate_install[vardepsexclude] += "buildhistory_emit_pkghistory"
+# If BUILDHISTORY_FORCE_UPDATE is not set, we want to avoid influencing the
+# signatures of sstate tasks - first the function itself:
+sstate_install[vardepsexclude] += "${@'' if d.getVar('BUILDHISTORY_FORCE_UPDATE', True) == '1' else 'buildhistory_emit_pkghistory'}"
 # then the value added to SSTATEPOSTINSTFUNCS:
-SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "| buildhistory_emit_pkghistory"
+SSTATEPOSTINSTFUNCS[vardepvalueexclude] .= "${@'' if d.getVar('BUILDHISTORY_FORCE_UPDATE', True) == '1' else '| buildhistory_emit_pkghistory'"
 
 # Similarly for our function that gets the output signatures
 SSTATEPOSTUNPACKFUNCS_append = " buildhistory_emit_outputsigs"
-- 
1.9.1




More information about the Openembedded-core mailing list