mirror of
https://git.yoctoproject.org/poky
synced 2026-05-09 17:39:31 +00:00
ref-manual: Updates to describe wildcarding support
Added specific wildcarding support descriptions for all related variables and file panthnames. (From yocto-docs rev: 543e398c4ae1bce38517a88cd91c957a583a2892) Signed-off-by: Scott Rifenbark <srifenbark@gmail.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
This commit is contained in:
committed by
Richard Purdie
parent
afec74f512
commit
4b4b9c9c19
@@ -29,11 +29,31 @@
|
|||||||
information in the similarly-named recipe file.
|
information in the similarly-named recipe file.
|
||||||
For an example of an append file in use, see the
|
For an example of an append file in use, see the
|
||||||
"<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
|
"<ulink url='&YOCTO_DOCS_DEV_URL;#using-bbappend-files'>Using .bbappend Files in Your Layer</ulink>"
|
||||||
section in the Yocto Project Development Tasks Manual.
|
section in the Yocto Project Development Tasks Manual.</para>
|
||||||
<note>
|
|
||||||
Append files can also use wildcard patterns in their
|
<para>When you name an append file, you can use the
|
||||||
version numbers so they can be applied to more than one
|
"<filename>%</filename>" wildcard character to allow for
|
||||||
version of the underlying recipe file.
|
matching recipe names.
|
||||||
|
For example, suppose you have an append file named as follows:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
busybox_1.21.%.bbappend
|
||||||
|
</literallayout>
|
||||||
|
That append file would match any
|
||||||
|
<filename>busybox_1.21.</filename><replaceable>x</replaceable><filename>.bb</filename>
|
||||||
|
version of the recipe.
|
||||||
|
So, the append file would match the following recipe names:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
busybox_1.21.1.bb
|
||||||
|
busybox_1.21.2.bb
|
||||||
|
busybox_1.21.3.bb
|
||||||
|
</literallayout>
|
||||||
|
<note><title>Important</title>
|
||||||
|
The use of the "<filename>%</filename>" character
|
||||||
|
is limited in that it only works directly in front of the
|
||||||
|
<filename>.bbappend</filename> portion of the append file's
|
||||||
|
name.
|
||||||
|
You cannot use the wildcard character in any other
|
||||||
|
location of the name.
|
||||||
</note>
|
</note>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para id='bitbake-term'>
|
<listitem><para id='bitbake-term'>
|
||||||
|
|||||||
@@ -679,6 +679,13 @@
|
|||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
BB_ALLOWED_NETWORKS = "*.gnu.org"
|
BB_ALLOWED_NETWORKS = "*.gnu.org"
|
||||||
</literallayout>
|
</literallayout>
|
||||||
|
<note><title>Important</title>
|
||||||
|
The use of the "<filename>*</filename>"
|
||||||
|
character only works at the beginning of
|
||||||
|
a host name.
|
||||||
|
You cannot use the wildcard character in any
|
||||||
|
other location of the name.
|
||||||
|
</note>
|
||||||
</para></listitem>
|
</para></listitem>
|
||||||
<listitem><para>
|
<listitem><para>
|
||||||
Mirrors not in the host list are skipped and
|
Mirrors not in the host list are skipped and
|
||||||
@@ -1133,12 +1140,22 @@
|
|||||||
|
|
||||||
<glossentry id='var-BBFILES'><glossterm>BBFILES</glossterm>
|
<glossentry id='var-BBFILES'><glossterm>BBFILES</glossterm>
|
||||||
<info>
|
<info>
|
||||||
BBFILES[doc] = "List of recipe files used by BitBake to build software."
|
BBFILES[doc] = "A space-separated list of recipe files BitBake uses to build software."
|
||||||
</info>
|
</info>
|
||||||
<glossdef>
|
<glossdef>
|
||||||
<para role="glossdeffirst">
|
<para role="glossdeffirst">
|
||||||
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
|
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
|
||||||
List of recipe files used by BitBake to build software.
|
A space-separated list of recipe files BitBake uses to
|
||||||
|
build software.
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
When specifying recipe files, you can pattern match using
|
||||||
|
Python's
|
||||||
|
<ulink url='https://docs.python.org/2/library/glob.html'><filename>glob</filename></ulink>
|
||||||
|
syntax.
|
||||||
|
For details on the syntax, see the documentation by
|
||||||
|
following the previous link.
|
||||||
</para>
|
</para>
|
||||||
</glossdef>
|
</glossdef>
|
||||||
</glossentry>
|
</glossentry>
|
||||||
@@ -1267,15 +1284,19 @@
|
|||||||
match any of the expressions.
|
match any of the expressions.
|
||||||
It is as if BitBake does not see them at all.
|
It is as if BitBake does not see them at all.
|
||||||
Consequently, matching files are not parsed or otherwise
|
Consequently, matching files are not parsed or otherwise
|
||||||
used by BitBake.</para>
|
used by BitBake.
|
||||||
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
The values you provide are passed to Python's regular
|
The values you provide are passed to Python's regular
|
||||||
expression compiler.
|
expression compiler.
|
||||||
|
Consequently, the syntax follows Python's Regular
|
||||||
|
Expression (re) syntax.
|
||||||
The expressions are compared against the full paths to
|
The expressions are compared against the full paths to
|
||||||
the files.
|
the files.
|
||||||
For complete syntax information, see Python's
|
For complete syntax information, see Python's
|
||||||
documentation for the appropriate release at
|
documentation at
|
||||||
<ulink url='http://docs.python.org/release/'></ulink>.
|
<ulink url='http://docs.python.org/release/2.3/lib/re-syntax.html'></ulink>.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@@ -1443,6 +1464,17 @@
|
|||||||
set up during compilation so that they are correct for
|
set up during compilation so that they are correct for
|
||||||
use when installed into the sysroot and called by the
|
use when installed into the sysroot and called by the
|
||||||
build processes of other recipes.
|
build processes of other recipes.
|
||||||
|
<note>
|
||||||
|
The <filename>BINCONFIG_GLOB</filename> variable
|
||||||
|
uses
|
||||||
|
<ulink url='http://tldp.org/LDP/abs/html/globbingref.html'>shell globbing</ulink>,
|
||||||
|
which is recognition and expansion of wildcards during
|
||||||
|
pattern matching.
|
||||||
|
Shell globbing is very similar to
|
||||||
|
<ulink url='https://docs.python.org/2/library/fnmatch.html#module-fnmatch'><filename>fnmatch</filename></ulink>
|
||||||
|
and
|
||||||
|
<ulink url='https://docs.python.org/2/library/glob.html'><filename>glob</filename></ulink>.
|
||||||
|
</note>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
@@ -2366,6 +2398,14 @@
|
|||||||
Defines wildcards to match when installing a list of
|
Defines wildcards to match when installing a list of
|
||||||
complementary packages for all the packages explicitly
|
complementary packages for all the packages explicitly
|
||||||
(or implicitly) installed in an image.
|
(or implicitly) installed in an image.
|
||||||
|
<note>
|
||||||
|
The <filename>COMPLEMENTARY_GLOB</filename> variable
|
||||||
|
uses Unix filename pattern matching
|
||||||
|
(<ulink url='https://docs.python.org/2/library/fnmatch.html#module-fnmatch'><filename>fnmatch</filename></ulink>),
|
||||||
|
which is similar to the Unix style pathname pattern
|
||||||
|
expansion
|
||||||
|
(<ulink url='https://docs.python.org/2/library/glob.html'><filename>glob</filename></ulink>).
|
||||||
|
</note>
|
||||||
The resulting list of complementary packages is associated
|
The resulting list of complementary packages is associated
|
||||||
with an item that can be added to
|
with an item that can be added to
|
||||||
<link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
|
<link linkend='var-IMAGE_FEATURES'><filename>IMAGE_FEATURES</filename></link>.
|
||||||
@@ -4782,23 +4822,38 @@
|
|||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
FILES_${PN} += "${bindir}/mydir1 ${bindir}/mydir2/myfile"
|
FILES_${PN} += "${bindir}/mydir1 ${bindir}/mydir2/myfile"
|
||||||
</literallayout>
|
</literallayout>
|
||||||
|
<note><title>Notes</title>
|
||||||
|
<itemizedlist>
|
||||||
|
<listitem><para>
|
||||||
|
When specifying files or paths, you can pattern
|
||||||
|
match using Python's
|
||||||
|
<ulink url='https://docs.python.org/2/library/glob.html'><filename>glob</filename></ulink>
|
||||||
|
syntax.
|
||||||
|
For details on the syntax, see the
|
||||||
|
documentation by following the previous link.
|
||||||
|
</para></listitem>
|
||||||
|
<listitem><para>
|
||||||
|
When specifying paths as part of the
|
||||||
|
<filename>FILES</filename> variable, it is
|
||||||
|
good practice to use appropriate path
|
||||||
|
variables.
|
||||||
|
For example, use <filename>${sysconfdir}</filename>
|
||||||
|
rather than <filename>/etc</filename>, or
|
||||||
|
<filename>${bindir}</filename> rather than
|
||||||
|
<filename>/usr/bin</filename>.
|
||||||
|
You can find a list of these variables at the
|
||||||
|
top of the
|
||||||
|
<filename>meta/conf/bitbake.conf</filename>
|
||||||
|
file in the
|
||||||
|
<link linkend='source-directory'>Source Directory</link>.
|
||||||
|
You will also find the default values of the
|
||||||
|
various <filename>FILES_*</filename> variables
|
||||||
|
in this file.
|
||||||
|
</para></listitem>
|
||||||
|
</itemizedlist>
|
||||||
|
</note>
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<note>
|
|
||||||
When specifying paths as part of the
|
|
||||||
<filename>FILES</filename> variable, it is good practice
|
|
||||||
to use appropriate path variables.
|
|
||||||
For example, use <filename>${sysconfdir}</filename> rather
|
|
||||||
than <filename>/etc</filename>, or
|
|
||||||
<filename>${bindir}</filename> rather than
|
|
||||||
<filename>/usr/bin</filename>.
|
|
||||||
You can find a list of these variables at the top of the
|
|
||||||
<filename>meta/conf/bitbake.conf</filename> file in the
|
|
||||||
<link linkend='source-directory'>Source Directory</link>.
|
|
||||||
You will also find the default values of the various
|
|
||||||
<filename>FILES_*</filename> variables in this file.
|
|
||||||
</note>
|
|
||||||
|
|
||||||
<para>
|
<para>
|
||||||
If some of the files you provide with the
|
If some of the files you provide with the
|
||||||
<filename>FILES</filename> variable are editable and you
|
<filename>FILES</filename> variable are editable and you
|
||||||
@@ -10935,47 +10990,63 @@ recipes-graphics/xorg-font/font-alias_1.0.3.bb:PR = "${INC_PR}.3"
|
|||||||
<glossdef>
|
<glossdef>
|
||||||
<para role="glossdeffirst">
|
<para role="glossdeffirst">
|
||||||
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
|
<!-- <para role="glossdeffirst"><imagedata fileref="figures/define-generic.png" /> -->
|
||||||
If there are multiple versions of recipes available, this
|
If multiple versions of recipes exist, this
|
||||||
variable determines which recipe should be given preference.
|
variable determines which version is given preference.
|
||||||
You must always suffix the variable with the
|
You must always suffix the variable with the
|
||||||
<link linkend='var-PN'><filename>PN</filename></link>
|
<link linkend='var-PN'><filename>PN</filename></link>
|
||||||
you want to select, and you should set the
|
you want to select, and you should set the
|
||||||
<link linkend='var-PV'><filename>PV</filename></link>
|
<link linkend='var-PV'><filename>PV</filename></link>
|
||||||
accordingly for precedence.
|
accordingly for precedence.
|
||||||
You can use the "<filename>%</filename>" character as a
|
</para>
|
||||||
wildcard to match any number of characters, which can be
|
|
||||||
useful when specifying versions that contain long revision
|
<para>
|
||||||
numbers that could potentially change.
|
The <filename>PREFERRED_VERSION</filename> variable
|
||||||
|
supports limited wildcard use through the
|
||||||
|
"<filename>%</filename>" character.
|
||||||
|
You can use the character to match any number of
|
||||||
|
characters, which can be useful when specifying versions
|
||||||
|
that contain long revision numbers that potentially change.
|
||||||
Here are two examples:
|
Here are two examples:
|
||||||
<literallayout class='monospaced'>
|
<literallayout class='monospaced'>
|
||||||
PREFERRED_VERSION_python = "3.4.0"
|
PREFERRED_VERSION_python = "3.4.0"
|
||||||
PREFERRED_VERSION_linux-yocto = "4.12%"
|
PREFERRED_VERSION_linux-yocto = "4.12%"
|
||||||
</literallayout>
|
</literallayout>
|
||||||
<note>
|
<note><title>Important</title>
|
||||||
The specified version is matched against
|
The use of the "<filename>%</filename>" character
|
||||||
<link linkend='var-PV'><filename>PV</filename></link>,
|
is limited in that it only works at the end of the
|
||||||
which does not necessarily match the version part of
|
string.
|
||||||
the recipe's filename.
|
You cannot use the wildcard character in any other
|
||||||
For example, consider two recipes
|
location of the string.
|
||||||
<filename>foo_1.2.bb</filename> and
|
|
||||||
<filename>foo_git.bb</filename> where
|
|
||||||
<filename>foo_git.bb</filename> contains the following
|
|
||||||
assignment:
|
|
||||||
<literallayout class='monospaced'>
|
|
||||||
PV = "1.1+git${SRCPV}"
|
|
||||||
</literallayout>
|
|
||||||
In this case, the correct way to select
|
|
||||||
<filename>foo_git.bb</filename> is by using an
|
|
||||||
assignment such as the following:
|
|
||||||
<literallayout class='monospaced'>
|
|
||||||
PREFERRED_VERSION_foo = "1.1+git%"
|
|
||||||
</literallayout>
|
|
||||||
Compare that previous example against the following
|
|
||||||
incorrect example, which does not work:
|
|
||||||
<literallayout class='monospaced'>
|
|
||||||
PREFERRED_VERSION_foo = "git"
|
|
||||||
</literallayout>
|
|
||||||
</note>
|
</note>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
|
The specified version is matched against
|
||||||
|
<link linkend='var-PV'><filename>PV</filename></link>,
|
||||||
|
which does not necessarily match the version part of
|
||||||
|
the recipe's filename.
|
||||||
|
For example, consider two recipes
|
||||||
|
<filename>foo_1.2.bb</filename> and
|
||||||
|
<filename>foo_git.bb</filename> where
|
||||||
|
<filename>foo_git.bb</filename> contains the following
|
||||||
|
assignment:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
PV = "1.1+git${SRCPV}"
|
||||||
|
</literallayout>
|
||||||
|
In this case, the correct way to select
|
||||||
|
<filename>foo_git.bb</filename> is by using an
|
||||||
|
assignment such as the following:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
PREFERRED_VERSION_foo = "1.1+git%"
|
||||||
|
</literallayout>
|
||||||
|
Compare that previous example against the following
|
||||||
|
incorrect example, which does not work:
|
||||||
|
<literallayout class='monospaced'>
|
||||||
|
PREFERRED_VERSION_foo = "git"
|
||||||
|
</literallayout>
|
||||||
|
</para>
|
||||||
|
|
||||||
|
<para>
|
||||||
Sometimes the <filename>PREFERRED_VERSION</filename>
|
Sometimes the <filename>PREFERRED_VERSION</filename>
|
||||||
variable can be set by configuration files in a way that
|
variable can be set by configuration files in a way that
|
||||||
is hard to change.
|
is hard to change.
|
||||||
|
|||||||
Reference in New Issue
Block a user