summaryrefslogtreecommitdiffstats
path: root/bitbake/doc/user-manual
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-18 14:24:13 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2014-01-27 21:03:21 +0000
commit908fdb5cbce63e097b7c3f74205796bdf2cdbd08 (patch)
treeeb920db49151c5dc0eec28f2b99b23f8d412439d /bitbake/doc/user-manual
parentc676bf8453523e29bb5977610f7bdaebb1546788 (diff)
downloadast2050-yocto-poky-908fdb5cbce63e097b7c3f74205796bdf2cdbd08.zip
ast2050-yocto-poky-908fdb5cbce63e097b7c3f74205796bdf2cdbd08.tar.gz
bitbake: user-manual-metadata: Add section about data store operations
(Bitbake rev: 85ffd05f292386de1b098debb6a3d3fe18c6b6b7) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake/doc/user-manual')
-rw-r--r--bitbake/doc/user-manual/user-manual-metadata.xml69
1 files changed, 69 insertions, 0 deletions
diff --git a/bitbake/doc/user-manual/user-manual-metadata.xml b/bitbake/doc/user-manual/user-manual-metadata.xml
index 53f677e..23b3fa6 100644
--- a/bitbake/doc/user-manual/user-manual-metadata.xml
+++ b/bitbake/doc/user-manual/user-manual-metadata.xml
@@ -741,4 +741,73 @@ python do_printdate () {
</para>
</section>
</section>
+
+ <section id='accessing-variables-and-the-data-store-from-python'>
+ <title>Accessing Variables and the Data Store from Python</title>
+
+ <para>
+ It is often necessary to manipulate variables within python functions
+ and the Bitbake data store has an API which allows this.
+ The operations available are:
+ <literallayout class='monospaced'>
+ d.getVar("X", expand=False)
+ </literallayout>
+ returns the value of variable "X", expanding the value
+ if specified.
+ <literallayout class='monospaced'>
+ d.setVar("X", value)
+ </literallayout>
+ sets the value of "X" to "value".
+ <literallayout class='monospaced'>
+ d.appendVar("X", value)
+ </literallayout>
+ adds "value" to the end of variable X.
+ <literallayout class='monospaced'>
+ d.prependVar("X", value)
+ </literallayout>
+ adds "value" to the start of variable X.
+ <literallayout class='monospaced'>
+ d.delVar("X")
+ </literallayout>
+ deletes the variable X from the data store.
+ <literallayout class='monospaced'>
+ d.renameVar("X", "Y")
+ </literallayout>
+ renames variable X to Y.
+ <literallayout class='monospaced'>
+ d.getVarFlag("X", flag, expand=False)
+ </literallayout>
+ gets given flag from variable X but does not expand it.
+ <literallayout class='monospaced'>
+ d.setVarFlag("X", flag, value)
+ </literallayout>
+ sets given flag for variable X to value.
+ <filename>setVarFlags</filename> will not clear previous flags.
+ Think of this method as <filename>addVarFlags</filename>.
+ <literallayout class='monospaced'>
+ d.appendVarFlag("X", flag, value)
+ </literallayout>
+ Need description.
+ <literallayout class='monospaced'>
+ d.prependVarFlag("X", flag, value)
+ </literallayout>
+ Need description.
+ <literallayout class='monospaced'>
+ d.delVarFlag("X", flag)
+ </literallayout>
+ Need description.
+ <literallayout class='monospaced'>
+ d.setVarFlags("X", flagsdict)
+ </literallayout>
+ sets the flags specified in the <filename>dict()</filename> parameter.
+ <literallayout class='monospaced'>
+ d.getVarFlags("X")
+ </literallayout>
+ returns a <filename>dict</filename> of the flags for X.
+ <literallayout class='monospaced'>
+ d.delVarFlags
+ </literallayout>
+ deletes all the flags for a variable.
+ </para>
+ </section>
</chapter>
OpenPOWER on IntegriCloud