Management of multiple pre-processing keys by the build control script
Context
The current main
version of the NEMO build control script makenemo
only supports the setting, addition, and removal of a single pre-processor key via its def_key
, add_key
, and del_key
options, respectively; if lists of keys are supplied as arguments, only the first element is used.
Analysis
A pre-processing key or key list is expected to be supplied as a single argument by scripts mk/Fdef_key.sh
, mk/Fadd_key.sh
, and mk/Fdel_key.sh
. In makenemo
, however, key lists expand into multiple arguments supplied to these scripts, and, as a result, only the first of the listed keys is processed.
Fix
Enclosing the pre-processing key list supplied to scripts mk/Fdef_key.sh
, mk/Fadd_key.sh
, and mk/Fdel_key.sh
in double quotes,
--- a/makenemo
+++ b/makenemo
@@ -336,9 +336,9 @@ fi
# CPP keys addition/removal
-[ -n "${list_add_key}" ] && ${COMPIL_DIR}/Fadd_keys.sh ${NEMO_TDIR}/${CUR_CONF} ${list_add_key}
-[ -n "${list_def_key}" ] && ${COMPIL_DIR}/Fdef_keys.sh ${NEMO_TDIR}/${CUR_CONF} ${list_def_key}
-[ -n "${list_del_key}" ] && ${COMPIL_DIR}/Fdel_keys.sh ${NEMO_TDIR}/${CUR_CONF} ${list_del_key}
+[ -n "${list_add_key}" ] && ${COMPIL_DIR}/Fadd_keys.sh ${NEMO_TDIR}/${CUR_CONF} "${list_add_key}"
+[ -n "${list_def_key}" ] && ${COMPIL_DIR}/Fdef_keys.sh ${NEMO_TDIR}/${CUR_CONF} "${list_def_key}"
+[ -n "${list_del_key}" ] && ${COMPIL_DIR}/Fdel_keys.sh ${NEMO_TDIR}/${CUR_CONF} "${list_del_key}"
# CPP keys check
would ensure the whole key list is supplied as a single argument.