Open jelly opened 3 weeks ago
It's definitely not working as one would expect, but
python -m mkosi -E 'FOO=foo\ bar' -E BAR='qux quz' summary
shows the two different versions, with the former working and the latter not. FOO
will have value foo bar
and BAR
will have value qux
, with another broken environment variable quz
as in your example.
The parser for the environment variables works as expected, but the problem is getting the right thing through from the shell.
The Environment=
setting worked for me, when I quickly tested it by adding a line to the test.
As far as I can it's due to the delimiter being a space in
ConfigSetting(
dest="environment",
short="-E",
metavar="NAME[=VALUE]",
section="Content",
parse=config_make_dict_parser(delimiter=" ", parse=parse_environment, unescape=True),
match=config_match_key_value,
help="Set an environment variable when running scripts",
),
So this seems to implicate that you can pass multiple env vars via one --environment
invocation which is not something I would expect. That is proven by:
python -m mkosi -E 'FOO=1 BAR=1' summary
FOO=1
BAR=1
mkosi commit the issue has been seen with
main
Used host distribution
Arch Linux
Used target distribution
Arch Linux
Linux kernel version used
No response
CPU architectures issue was seen on
x86_64
Unexpected behaviour you saw
Trying to pass an environment variable with spaces causes the splits it up making it impossible to pass something like "-O ^orphan_file".
This is not an issue with
--env-file
FYI, Haven't testedEnviroment
as a Config option.Debug print of the passed env variable to systemd-repart
Used mkosi config
No response
mkosi output
No response