summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-02-29 02:51:08 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-02-29 02:51:08 +0000
commit4dc51411ccbef104a5ce72735985a38053ff5398 (patch)
tree62a1714168f5591844da50bc015fc100a1c0b9c4
parent2f75770abad7cdd1b3b23ad28dbc60292bd4d65b (diff)
downloadmidipix_build-4dc51411ccbef104a5ce72735985a38053ff5398.tar.bz2
midipix_build-4dc51411ccbef104a5ce72735985a38053ff5398.tar.xz
subr/build_init.subr:buildp_init_vars(): reject unknown groups.
-rw-r--r--subr/build_init.subr26
1 files changed, 17 insertions, 9 deletions
diff --git a/subr/build_init.subr b/subr/build_init.subr
index 27af80da..213bf7d6 100644
--- a/subr/build_init.subr
+++ b/subr/build_init.subr
@@ -179,7 +179,7 @@ buildp_init_getopts() {
};
buildp_init_vars() {
- local _default_build_groups="" _fname="" _rc=0 _target=""; _status="";
+ local _default_build_groups="" _fname="" _group="" _groups="" _rc=0; _status="";
if ! rtl_lmatch "${ARCH}" "nt32 nt64"; then
_rc=1; _status="Error: invalid architecture \`${ARCH}'.";
elif ! rtl_lmatch "${BUILD}" "debug release"; then
@@ -208,17 +208,20 @@ buildp_init_vars() {
for _fname in $(find ./groups -name *.group | sort); do
rtl_fileop source_opt "${_fname}";
if [ -n "${GROUP_TARGET}" ]; then
- _target="${GROUP_TARGET}"; unset GROUP_TARGET;
+ _group="${GROUP_TARGET}"; unset GROUP_TARGET;
else
- _fname="${_fname##*/}"; _fname="${_fname%.group}"; _target="${_fname#*.}";
+ _group="${_fname##*/}"; _group="${_group%.group}"; _group="${_group#*.}";
fi;
- if [ -n "${GROUP_AUTO}" ]; then
- if [ "${GROUP_AUTO:-0}" -ne 0 ]; then
- _default_build_groups="$(rtl_lconcat "${_default_build_groups}" "${_target}")";
+ if ! rtl_lmatch "${_groups}" "${_group}"; then
+ _groups="$(rtl_lconcat "${_groups}" "${_group}")";
+ if [ -n "${GROUP_AUTO}" ]; then
+ if [ "${GROUP_AUTO:-0}" -ne 0 ]; then
+ _default_build_groups="$(rtl_lconcat "${_default_build_groups}" "${_group}")";
+ fi;
+ unset GROUP_AUTO;
+ else
+ _default_build_groups="$(rtl_lconcat "${_default_build_groups}" "${_group}")";
fi;
- unset GROUP_AUTO;
- else
- _default_build_groups="$(rtl_lconcat "${_default_build_groups}" "${_target}")";
fi;
done;
_default_build_groups="$(rtl_uniq "${_default_build_groups}")";
@@ -229,6 +232,11 @@ buildp_init_vars() {
BUILD_GROUPS="${_default_build_groups}";
fi;
BUILD_GROUPS="$(rtl_lconcat "$(rtl_lfilter "${BUILD_GROUPS}" "invariants")" "invariants")";
+ for _group in ${BUILD_GROUPS}; do
+ if ! rtl_lmatch "${_groups}" "${_group}"; then
+ _rc=1; _status="Error: unknown build group \`${_group}'."; break;
+ fi;
+ done;
fi;
fi;
return "${_rc}";