commit: e9eaf78b66f511ff8c4f38cd42a8d0bcdf5180a7 Author: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> AuthorDate: Sat Jul 20 22:09:56 2019 +0000 Commit: Thomas Deutschmann <whissi <AT> gentoo <DOT> org> CommitDate: Sun Jul 21 16:02:01 2019 +0000 URL: https://gitweb.gentoo.org/proj/genkernel.git/commit/?id=e9eaf78b
gen_funcs.sh: set_config_with_override(): Bail out when we failed to set config variable Signed-off-by: Thomas Deutschmann <whissi <AT> gentoo.org> gen_funcs.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/gen_funcs.sh b/gen_funcs.sh index 6161405..9aa4e24 100755 --- a/gen_funcs.sh +++ b/gen_funcs.sh @@ -1317,14 +1317,18 @@ set_config_with_override() { then Result=${!CfgVar} # we need to set the CMD_* according to configfile... - eval ${OverrideVar}=\"${Result}\" + eval ${OverrideVar}=\"${Result}\" \ + || small_die "Failed to set variable '${OverrideVar}=${Result}' !" + print_info 5 " $CfgVar set in config file to \"${Result}\"." else if [ -n "$Default" ] then Result=${Default} # set OverrideVar to Result, otherwise CMD_* may not be initialized... - eval ${OverrideVar}=\"${Result}\" + eval ${OverrideVar}=\"${Result}\" \ + || small_die "Failed to set variable '${OverrideVar}=${Result}' !" + print_info 5 " $CfgVar defaulted to \"${Result}\"." else print_info 5 " $CfgVar not set." @@ -1342,7 +1346,8 @@ set_config_with_override() { fi fi - eval ${CfgVar}=\"${Result}\" + eval ${CfgVar}=\"${Result}\" \ + || small_die "Failed to set variable '${CfgVar}=${Result}' !" } # @FUNCTION: restore_boot_mount_state