add conditional environment variables
Until now all environment variables in the kas config's env section require a default value. In some cases we want to rely on the weak assignment of bitbake instead of relying on the default value of the variable in the kas config. This means if we assign the 'None' value or nothing to the variable in the kas config then it is only added to BB_ENV_EXTRAWHITE or BB_ENV_PASSTHROUGH_ADDITIONS without setting it as environment variable. Signed-off-by: Benedikt Niedermayr <benedikt.niedermayr@siemens.com> [Jan: fixed overlong line] Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
parent
102c4667d1
commit
c38517df83
@ -121,3 +121,12 @@ Added
|
|||||||
- For repositories, ``url`` and ``path`` can now be overridden with a
|
- For repositories, ``url`` and ``path`` can now be overridden with a
|
||||||
null-value to switch between version-controlled repositories and unversioned
|
null-value to switch between version-controlled repositories and unversioned
|
||||||
local folders.
|
local folders.
|
||||||
|
|
||||||
|
Version 13
|
||||||
|
----------
|
||||||
|
|
||||||
|
Added
|
||||||
|
~~~~~
|
||||||
|
|
||||||
|
- Variables used in the ``env`` section can now be assigned 'None' as value. In
|
||||||
|
this case the variables are only exported to the bb env whitelist.
|
||||||
|
@ -354,9 +354,14 @@ Configuration reference
|
|||||||
should be specified via the environment variable.
|
should be specified via the environment variable.
|
||||||
|
|
||||||
* ``env``: dict [optional]
|
* ``env``: dict [optional]
|
||||||
Contains environment variable names with the default values. These
|
Contains environment variable names with either default values or None.
|
||||||
variables are made available to bitbake via ``BB_ENV_EXTRAWHITE`` and can
|
These variables are made available to bitbake via ``BB_ENV_EXTRAWHITE``
|
||||||
be overwritten by the variables of the environment in which kas is started.
|
and can be overwritten by the variables of the environment in which
|
||||||
|
kas is started.
|
||||||
|
Either a string or nothing (None) can be assigned as value.
|
||||||
|
The former one serves as a default value whereas the latter one will lead
|
||||||
|
to add the variable only to ``BB_ENV_EXTRAWHITE`` and not to the
|
||||||
|
environment where kas is started.
|
||||||
|
|
||||||
* ``task``: string [optional]
|
* ``task``: string [optional]
|
||||||
Contains the task to build by bitbake. Can be overwritten by the
|
Contains the task to build by bitbake. Can be overwritten by the
|
||||||
|
@ -28,5 +28,5 @@ __copyright__ = 'Copyright (c) Siemens AG, 2017-2020'
|
|||||||
__version__ = '3.1'
|
__version__ = '3.1'
|
||||||
|
|
||||||
# Please update docs/format-changelog.rst when changing the file version.
|
# Please update docs/format-changelog.rst when changing the file version.
|
||||||
__file_version__ = 12
|
__file_version__ = 13
|
||||||
__compatible_file_version__ = 1
|
__compatible_file_version__ = 1
|
||||||
|
@ -275,6 +275,9 @@ def get_build_environ(build_system):
|
|||||||
if env_var in os.environ:
|
if env_var in os.environ:
|
||||||
env[env_var] = os.environ[env_var]
|
env[env_var] = os.environ[env_var]
|
||||||
|
|
||||||
|
# filter out 'None' values
|
||||||
|
env = {k: v for (k, v) in env.items() if v is not None}
|
||||||
|
|
||||||
return env
|
return env
|
||||||
|
|
||||||
|
|
||||||
|
@ -94,7 +94,7 @@
|
|||||||
"env": {
|
"env": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"additionalProperties": {
|
"additionalProperties": {
|
||||||
"type": "string"
|
"type": ["string", "null"]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"target": {
|
"target": {
|
||||||
|
Loading…
Reference in New Issue
Block a user