shell: Add option to keep current environment

When doing interactive development via kas shell it is often desirable
to keep the user's customized configuration. The new --preserve-env
argument has been added to support this scenario via an opt in flag.

This flag is blocked  when not running from a TTY or via kas-container
and kas issues a warning to the user about potential unintended side
effects when invoked.

Signed-off-by: Ryan Fairfax <rfairfax@linux.microsoft.com>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Ryan Fairfax
2022-02-23 02:02:01 +01:00
committed by Jan Kiszka
parent 3d35fe2f60
commit 32514c8f4f
3 changed files with 36 additions and 1 deletions

View File

@@ -289,6 +289,10 @@ while [ $# -gt 0 ] && [ $KAS_EXTRA_BITBAKE_ARGS -eq 0 ]; do
KAS_BITBAKE_C_OPTION_ARGS="$2"
shift 2
;;
-E|--preserve-env)
echo "$1 is not supported with kas-container"
exit 1
;;
--)
KAS_EXTRA_BITBAKE_ARGS=$#
;;