diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-28 17:51:42 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-07-31 10:32:45 +0100 |
commit | e384d9ba0c4a3335575a766a82ed79201d794b11 (patch) | |
tree | 8aadb36e089d163a98ce10ae2f6684ea34f8af68 /meta/classes/base.bbclass | |
parent | 64acfb32491e9b4666b55cac625eb13dafed2144 (diff) | |
download | poky-e384d9ba0c4a3335575a766a82ed79201d794b11.tar.gz |
pixbufcache: Use sceneQueueComplete event to simplify usage
Ensuring the native pixbuf cache is correct after new loaders have
been installed is tricky. This needs to be done without races
and work regardless of whether the build is from sstate or freshly
built for one or more modules.
This adds a hook into base.bbclass which is then triggered by the
code from pixbufcache. This patch is an improved version which
means base.bbclass has no pixbuf knowledge and the mechanism can
be reused in other cases.
(From OE-Core rev: b411085fefc8582d24c172db5f6610705eb44c2f)
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta/classes/base.bbclass')
-rw-r--r-- | meta/classes/base.bbclass | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/meta/classes/base.bbclass b/meta/classes/base.bbclass index e0f1053164..bfc78dba3a 100644 --- a/meta/classes/base.bbclass +++ b/meta/classes/base.bbclass | |||
@@ -204,8 +204,10 @@ def buildcfg_neededvars(d): | |||
204 | bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) | 204 | bb.fatal('The following variable(s) were not set: %s\nPlease set them directly, or choose a MACHINE or DISTRO that sets them.' % ', '.join(pesteruser)) |
205 | 205 | ||
206 | addhandler base_eventhandler | 206 | addhandler base_eventhandler |
207 | base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise" | 207 | base_eventhandler[eventmask] = "bb.event.ConfigParsed bb.event.BuildStarted bb.event.RecipePreFinalise bb.runqueue.sceneQueueComplete" |
208 | python base_eventhandler() { | 208 | python base_eventhandler() { |
209 | import bb.runqueue | ||
210 | |||
209 | if isinstance(e, bb.event.ConfigParsed): | 211 | if isinstance(e, bb.event.ConfigParsed): |
210 | if not e.data.getVar("NATIVELSBSTRING", False): | 212 | if not e.data.getVar("NATIVELSBSTRING", False): |
211 | e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data)) | 213 | e.data.setVar("NATIVELSBSTRING", lsb_distro_identifier(e.data)) |
@@ -241,6 +243,17 @@ python base_eventhandler() { | |||
241 | e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++") | 243 | e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}g++") |
242 | e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs") | 244 | e.data.delVar("PREFERRED_PROVIDER_virtual/${TARGET_PREFIX}compilerlibs") |
243 | 245 | ||
246 | if isinstance(e, bb.runqueue.sceneQueueComplete): | ||
247 | completions = e.data.expand("${STAGING_DIR}/sstatecompletions") | ||
248 | if os.path.exists(completions): | ||
249 | cmds = set() | ||
250 | with open(completions, "r") as f: | ||
251 | cmds = set(f) | ||
252 | e.data.setVar("completion_function", "\n".join(cmds)) | ||
253 | e.data.setVarFlag("completion_function", "func", "1") | ||
254 | bb.debug(1, "Executing SceneQueue Completion commands: %s" % "\n".join(cmds)) | ||
255 | bb.build.exec_func("completion_function", e.data) | ||
256 | os.remove(completions) | ||
244 | } | 257 | } |
245 | 258 | ||
246 | CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate" | 259 | CONFIGURESTAMPFILE = "${WORKDIR}/configure.sstate" |