summaryrefslogtreecommitdiff
path: root/functions
diff options
context:
space:
mode:
authorLyndon Brown <jnqnfe@gmail.com>2020-03-28 10:55:25 +0000
committerRaphaƫl Hertzog <hertzog@debian.org>2020-04-23 15:23:15 +0200
commitc57b8679a4664c83c50648c106ba224048cedeee (patch)
treeeec488ff5f096339ed6d903322d7c809a0a8787e /functions
parent3645719f22d344a0f2850986bdb5e90ca79f72b0 (diff)
downloadvyos-live-build-c57b8679a4664c83c50648c106ba224048cedeee.tar.gz
vyos-live-build-c57b8679a4664c83c50648c106ba224048cedeee.zip
config: fix broken backwards compatibility hack
80aa5ab61100b6b11ae47984bab9a2eb988074f5 implemented a hack to handle replacement of LB_LINUX_FLAVOURS with LB_LINUX_FLAVOURS_WITH_ARCH in config files, but implemented it in the wrong place. adding a conditional conversion within the config file meant that the old value would only be read from **new** config files that are created obviously without it, including re-saved configs if `lb config` were re-run with additional options (not recommended). any existing value in an existing config file would actually be ignored. the right place to read the old value was in the Set_defaults() function (since renamed). a second issue also existed with the hack, it failed to excape the `$` and thus printed the existing value of $LB_LINUX_FLAVOURS into the conditional check being constructed in the config file, instead of printing the name of the variable. the check embedded into the config file thus became this on an amd64 machine: ``` if [ -n "amd64" ] then LB_LINUX_FLAVOURS_WITH_ARCH="amd64" fi ``` which is clearly not what was intended. Gbp-Dch: Short
Diffstat (limited to 'functions')
-rwxr-xr-xfunctions/configuration.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/functions/configuration.sh b/functions/configuration.sh
index 8bacb52bc..decc564be 100755
--- a/functions/configuration.sh
+++ b/functions/configuration.sh
@@ -234,6 +234,10 @@ Prepare_config ()
LB_KEYRING_PACKAGES="${LB_KEYRING_PACKAGES:-debian-archive-keyring}"
+ # first, handle existing LB_LINUX_FLAVOURS for backwards compatibility
+ if [ -n "${LB_LINUX_FLAVOURS}" ]; then
+ LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS}"
+ fi
case "${LB_ARCHITECTURES}" in
arm64)
LB_LINUX_FLAVOURS_WITH_ARCH="${LB_LINUX_FLAVOURS_WITH_ARCH:-arm64}"