diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2019-07-21 00:09:56 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2019-07-21 18:02:01 +0200 |
commit | e9eaf78b66f511ff8c4f38cd42a8d0bcdf5180a7 (patch) | |
tree | 1b6cf5857806aea51837bbc31c271bbe02f1d6fa /gen_funcs.sh | |
parent | gen_initramfs.sh: append_mdadm(): Log when mdadm config was copied (diff) | |
download | genkernel-e9eaf78b66f511ff8c4f38cd42a8d0bcdf5180a7.tar.gz genkernel-e9eaf78b66f511ff8c4f38cd42a8d0bcdf5180a7.tar.bz2 genkernel-e9eaf78b66f511ff8c4f38cd42a8d0bcdf5180a7.zip |
gen_funcs.sh: set_config_with_override(): Bail out when we failed to set config variable
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'gen_funcs.sh')
-rwxr-xr-x | gen_funcs.sh | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/gen_funcs.sh b/gen_funcs.sh index 61614057..9aa4e24a 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 |