From c57b8679a4664c83c50648c106ba224048cedeee Mon Sep 17 00:00:00 2001 From: Lyndon Brown Date: Sat, 28 Mar 2020 10:55:25 +0000 Subject: 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 --- functions/configuration.sh | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'functions') 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}" -- cgit v1.2.3