diff --git a/docs/format-changelog.rst b/docs/format-changelog.rst index c8a7218..23c5380 100644 --- a/docs/format-changelog.rst +++ b/docs/format-changelog.rst @@ -121,3 +121,12 @@ Added - For repositories, ``url`` and ``path`` can now be overridden with a null-value to switch between version-controlled repositories and unversioned 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. diff --git a/docs/userguide.rst b/docs/userguide.rst index 6c058f1..a8c72ea 100644 --- a/docs/userguide.rst +++ b/docs/userguide.rst @@ -354,9 +354,14 @@ Configuration reference should be specified via the environment variable. * ``env``: dict [optional] - Contains environment variable names with the default values. These - variables are made available to bitbake via ``BB_ENV_EXTRAWHITE`` and can - be overwritten by the variables of the environment in which kas is started. + Contains environment variable names with either default values or None. + These variables are made available to bitbake via ``BB_ENV_EXTRAWHITE`` + 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] Contains the task to build by bitbake. Can be overwritten by the diff --git a/kas/__version__.py b/kas/__version__.py index cf3ffa3..e7bf1f3 100644 --- a/kas/__version__.py +++ b/kas/__version__.py @@ -28,5 +28,5 @@ __copyright__ = 'Copyright (c) Siemens AG, 2017-2020' __version__ = '3.1' # Please update docs/format-changelog.rst when changing the file version. -__file_version__ = 12 +__file_version__ = 13 __compatible_file_version__ = 1 diff --git a/kas/libkas.py b/kas/libkas.py index 4801d32..3cf2249 100644 --- a/kas/libkas.py +++ b/kas/libkas.py @@ -275,6 +275,9 @@ def get_build_environ(build_system): if env_var in os.environ: 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 diff --git a/kas/schema-kas.json b/kas/schema-kas.json index ca4b513..e42a236 100644 --- a/kas/schema-kas.json +++ b/kas/schema-kas.json @@ -94,7 +94,7 @@ "env": { "type": "object", "additionalProperties": { - "type": "string" + "type": ["string", "null"] } }, "target": {