toolbox/profile.d
Debarshi Ray f392a69a4b profile.d: Restore compatibility with Z shell
Otherwise, every zsh instance on Fedora Kinoite and Silverblue was
running into:
  /etc/profile.d/toolbox.sh:30: bad substitution

... because case modification with "${VARIANT_ID^}" is undefined in
POSIX shell [1], and doesn't work with Z shell.

Fedora Silverblue got its own PRETTY_NAME (and VARIANT and VARIANT_ID)
starting from Fedora 32 [2].  Therefore, it's better to use PRETTY_NAME
and let the downstream distributor of the host operating system decide
how it should be presented to the user, instead of coming up with a
custom string.  eg., PRETTY_NAME isn't the same as "Fedora $VARIANT" on
Fedora Silverblue.

One nice side-effect of this is that while VARIANT and VARIANT_ID are
optional fields, PRETTY_NAME has a well-defined fallback value of
'Linux' [3].  This makes this a little less specific to Fedora Kinoite
and Silverblue.

The rest of the welcome text was reformatted to prevent it from getting
too wide depending on the contents of PRETTY_NAME.

Fallout from 3641a0032f

[1] https://www.shellcheck.net/wiki/SC3059

[2] https://pagure.io/workstation-ostree-config/c/c18ef957d11862d32f362722931dbfdf1f5beb0d

[3] https://www.freedesktop.org/software/systemd/man/os-release.html

https://github.com/containers/toolbox/issues/1017
2022-11-25 18:36:31 +01:00
..
meson.build build: Tweak the names of the ShellCheck tests 2022-09-09 17:16:25 +02:00
toolbox.sh profile.d: Restore compatibility with Z shell 2022-11-25 18:36:31 +01:00