diff options
author | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-12-03 19:46:36 +0000 |
---|---|---|
committer | Lucio Andrés Illanes Albornoz (arab, vxp) <lucio@lucioillanes.de> | 2017-12-03 19:46:36 +0000 |
commit | 0ddc1e323bdcfb9c3bc544327e480da8e4a74a85 (patch) | |
tree | 6230fcba02551c5c9bdf26ba61ece504e66bde45 /subr | |
parent | 430898235832e333d5d05042bcc47a26d297c985 (diff) | |
download | midipix_build-0ddc1e323bdcfb9c3bc544327e480da8e4a74a85.tar.bz2 midipix_build-0ddc1e323bdcfb9c3bc544327e480da8e4a74a85.tar.xz |
vars/build.vars:*_minipix: fixed.
patches/{bash,bzip2,coreutils}_minipix-*.patch: linked.
subr/ex_pkg_env.subr, var/env.vars: replaces flavours mechanism w/ non-recursive per-package ${PKG_INHERIT_FROM}.
subr/pkg_configure_patch.subr: remove ${PKG_NAME_PARENT} bits.
vars/{bash,xz}_minipix.vars: added/linked.
Diffstat (limited to 'subr')
-rw-r--r-- | subr/ex_pkg_env.subr | 26 | ||||
-rw-r--r-- | subr/pkg_configure_patch.subr | 36 |
2 files changed, 33 insertions, 29 deletions
diff --git a/subr/ex_pkg_env.subr b/subr/ex_pkg_env.subr index 822ac054..439041d9 100644 --- a/subr/ex_pkg_env.subr +++ b/subr/ex_pkg_env.subr @@ -4,12 +4,8 @@ exp_pkg_env_source() { local _pkg_name="${1}" _tgt_name="${2}" \ - _tgt_name_uc _pkg_name_uc _build_type_uc \ - _vname_dst _vars_set=""; - if [ "${_pkg_name#*_flavour_*}" != "${_pkg_name}" ]; then - PKG_NAME_PARENT="${PKG_NAME%_flavour_*}"; - ex_pkg_env_source "${PKG_NAME_PARENT}"; - fi; + _tgt_name_uc _pkg_name_uc _pkg_name_inherit_uc \ + _build_type_uc _vname_dst _vars_set=""; ex_rtl_fileop source_opt "vars/${_pkg_name}.vars"; _tgt_name_uc="$(ex_rtl_toupper "${_tgt_name}")"; _pkg_name_uc="$(ex_rtl_toupper "${_pkg_name}")"; @@ -17,12 +13,22 @@ exp_pkg_env_source() { "DEFAULT ${_tgt_name_uc} PKG_${_pkg_name_uc}" \ _vars_set; _build_type_uc="$(ex_rtl_toupper "${PKG_BUILD_TYPE}")"; + ex_rtl_set_vars INHERIT_FROM "PKG_${_pkg_name_uc}" _vars_set; + _pkg_name_inherit_uc="$(ex_rtl_toupper "${PKG_INHERIT_FROM}")"; for _vname_dst in $(ex_rtl_lfilter_not \ "${DEFAULT_BUILD_VARS}" BUILD_TYPE); do - ex_rtl_set_vars "${_vname_dst}" \ - "DEFAULT DEFAULT_${_build_type_uc} \ - ${_tgt_name_uc} PKG_${_pkg_name_uc}" \ - _vars_set; + if [ -n "${_pkg_name_inherit_uc}" ]; then + ex_rtl_set_vars "${_vname_dst}" \ + "DEFAULT DEFAULT_${_build_type_uc} \ + ${_tgt_name_uc} \ + PKG_${_pkg_name_inherit_uc} \ + PKG_${_pkg_name_uc}" _vars_set; + else + ex_rtl_set_vars "${_vname_dst}" \ + "DEFAULT DEFAULT_${_build_type_uc} \ + ${_tgt_name_uc} PKG_${_pkg_name_uc}" \ + _vars_set; + fi; done; ex_rtl_unset_vars $(ex_rtl_lfilter_not \ "$(set | awk -F= '/^PKG_/{print $1}' | sort)" \ diff --git a/subr/pkg_configure_patch.subr b/subr/pkg_configure_patch.subr index 57939126..ab6ec61c 100644 --- a/subr/pkg_configure_patch.subr +++ b/subr/pkg_configure_patch.subr @@ -3,26 +3,24 @@ # pkg_configure_patch() { - local _pkg_name _pkg_name_full _patch_dir _patch_fname _patches_done; - for _pkg_name in "${PKG_NAME}" "${PKG_NAME_PARENT}"; do - if [ -z "${_pkg_name}" ]; then - continue; - else - _pkg_name_full="${_pkg_name}${PKG_VERSION:+-${PKG_VERSION}}"; - _patch_dir="${MIDIPIX_BUILD_PWD}/patches"; + local _pkg_name="${PKG_NAME}" _pkg_name_full _patch_dir _patch_fname _patches_done; + if [ -z "${_pkg_name}" ]; then + continue; + else + _pkg_name_full="${_pkg_name}${PKG_VERSION:+-${PKG_VERSION}}"; + _patch_dir="${MIDIPIX_BUILD_PWD}/patches"; + fi; + set +o noglob; for _patch_fname in \ + ${_patch_dir}/${_pkg_name}/*.patch \ + ${_patch_dir}/${_pkg_name_full}.local.patch \ + ${_patch_dir}/${_pkg_name_full}.local@${BUILD_HNAME}.patch \ + "${PKG_PATCHES_EXTRA}"; do + if [ -r "${_patch_fname}" ]\ + && ! ex_rtl_lmatch "${_patches_done}" " " "${_patch_fname}"; then + patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}"; + _patches_done="${_patches_done:+${_patches_done} }${_patch_fname}"; fi; - set +o noglob; for _patch_fname in \ - ${_patch_dir}/${_pkg_name}/*.patch \ - ${_patch_dir}/${_pkg_name_full}.local.patch \ - ${_patch_dir}/${_pkg_name_full}.local@${BUILD_HNAME}.patch \ - "${PKG_PATCHES_EXTRA}"; do - if [ -r "${_patch_fname}" ]\ - && ! ex_rtl_lmatch "${_patches_done}" " " "${_patch_fname}"; then - patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}"; - _patches_done="${_patches_done:+${_patches_done} }${_patch_fname}"; - fi; - done; set -o noglob; - done; + done; set -o noglob; }; # vim:filetype=sh |