diff options
author | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-08-25 16:53:31 +0200 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz <lucio@lucioillanes.de> | 2021-08-25 16:53:31 +0200 |
commit | 7751df93a858dd00037dea1d7017f52d45c80b6c (patch) | |
tree | 579e1ce1cd39efe2fc3a1bbce3bf12075cf43462 /subr | |
parent | 236b0a08ae46286ae319e870d8c396ae1ca24a9f (diff) | |
download | midipix_build-7751df93a858dd00037dea1d7017f52d45c80b6c.tar.bz2 midipix_build-7751df93a858dd00037dea1d7017f52d45c80b6c.tar.xz |
subr/ex_pkg_env.subr:exp_pkg_env_set(): correctly inherit ${PKG_VARS_FILE} given ${PKG_INHERIT_FROM}.
Diffstat (limited to 'subr')
-rw-r--r-- | subr/ex_pkg_env.subr | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/subr/ex_pkg_env.subr b/subr/ex_pkg_env.subr index f85c96e5..8f3cfcb7 100644 --- a/subr/ex_pkg_env.subr +++ b/subr/ex_pkg_env.subr @@ -111,12 +111,18 @@ exp_pkg_env_set() { ex_pkg_env() { local _build_steps_default="${1}" _build_vars_default="${2}" _group_name="${3}" \ _nounset="${4}" _pkg_name="${5}" _restart_at="${6}" _workdir="${7}" \ - _vars_file="" _vname=""; + _inherit_from="" _vars_file="" _vname=""; - if ! _vars_file="$(rtl_get_var_unsafe -u "PKG_${_pkg_name}_VARS_FILE")"\ - || [ "${#_vars_file}" -eq 0 ]; then + if _inherit_from="$(rtl_get_var_unsafe -u "PKG_${_pkg_name}_INHERIT_FROM")"\ + && [ "${#_inherit_from}" -gt 0 ]; then + _vars_file="$(rtl_get_var_unsafe -u "PKG_${_inherit_from}_VARS_FILE")"; + else + _vars_file="$(rtl_get_var_unsafe -u "PKG_${_pkg_name}_VARS_FILE")"; + fi; + if [ "${#_vars_file}" -eq 0 ]; then _vars_file="vars/${_pkg_name}.vars"; fi; + rtl_fileop source_opt "${_vars_file}" "${_group_name}/${_pkg_name}.${_group_name}"; if ! exp_pkg_env_set "${_build_vars_default}" "${_group_name}" "${_nounset}" "${_pkg_name}"\ || ! exp_pkg_env_defaults "${_build_steps_default}" "${_pkg_name}" "${_workdir}"; then |