summaryrefslogtreecommitdiffstats
path: root/bitbake/doc
diff options
context:
space:
mode:
authorRobert P. J. Day <rpjday@crashcourse.ca>2014-07-10 10:12:09 +0300
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-07-21 11:00:57 +0100
commit49627bbad387791053e50dde02b51a0f16fdc40e (patch)
tree6b05f0106c8c2b17e1c972f4a9408a8b955e873b /bitbake/doc
parente83032ce0a3f847e6a8fd5f5b64ee6aa7ec6b404 (diff)
downloadpoky-49627bbad387791053e50dde02b51a0f16fdc40e.tar.gz
bitbake: bitbake-user-manual-metadata.xml: Adding some flag examples.
As long as i've understood everything correctly, this is just throwing in some physical examples of a couple concepts. (Bitbake rev: a18cc69c2fef6484a6acd78ea008d1da71198e68) Signed-off-by: Scott Rifenbark <scott.m.rifenbark@intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc')
-rw-r--r--bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml25
1 files changed, 24 insertions, 1 deletions
diff --git a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
index b8a77e1fa0..5e1a381fac 100644
--- a/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
+++ b/bitbake/doc/bitbake-user-manual/bitbake-user-manual-metadata.xml
@@ -293,6 +293,17 @@
293 The flags are immediately set to "abc" and "123", respectively. 293 The flags are immediately set to "abc" and "123", respectively.
294 The <filename>a</filename> flag becomes "abc456". 294 The <filename>a</filename> flag becomes "abc456".
295 </para> 295 </para>
296
297 <para>
298 No need exists to pre-define variable flags.
299 You can simply start using them.
300 One extremely common application
301 is to attach some brief documentation to a BitBake variable as
302 follows:
303 <literallayout class='monospaced'>
304 CACHE[doc] = "The directory holding the cache of the metadata."
305 </literallayout>
306 </para>
296 </section> 307 </section>
297 308
298 <section id='inline-python-variable-expansion'> 309 <section id='inline-python-variable-expansion'>
@@ -306,7 +317,19 @@
306 DATE = "${@time.strftime('%Y%m%d',time.gmtime())}" 317 DATE = "${@time.strftime('%Y%m%d',time.gmtime())}"
307 </literallayout> 318 </literallayout>
308 This example results in the <filename>DATE</filename> 319 This example results in the <filename>DATE</filename>
309 variable becoming the current date. 320 variable being set to the current date.
321 </para>
322
323 <para>
324 Probably the most common use of this feature is to extract
325 the value of variables from BitBake's internal data dictionary,
326 <filename>d</filename>.
327 The following lines select the values of a package name
328 and its version number, respectively:
329 <literallayout class='monospaced'>
330 PN = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[0] or 'defaultpkgname'}"
331 PV = "${@bb.parse.BBHandler.vars_from_file(d.getVar('FILE'),d)[1] or '1.0'}"
332 </literallayout>
310 </para> 333 </para>
311 </section> 334 </section>
312 335