diff options
author | Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de> | 2024-04-24 15:24:48 +0200 |
---|---|---|
committer | Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de> | 2024-04-24 15:24:48 +0200 |
commit | b2c1ea9526151c4fed9dca8348019d718f489e76 (patch) | |
tree | 4d7e65a3553f0c3c4eabec884075a36eb5e56c2b /subr.ex | |
parent | 4e929dbbad9c3b8d2d88f7a44916f14758d39ee5 (diff) | |
download | midipix_build-b2c1ea9526151c4fed9dca8348019d718f489e76.tar.bz2 midipix_build-b2c1ea9526151c4fed9dca8348019d718f489e76.tar.xz |
Implements single package files.
Diffstat (limited to 'subr.ex')
-rw-r--r-- | subr.ex/ex_pkg.subr | 33 |
1 files changed, 32 insertions, 1 deletions
diff --git a/subr.ex/ex_pkg.subr b/subr.ex/ex_pkg.subr index c914360e..6c020702 100644 --- a/subr.ex/ex_pkg.subr +++ b/subr.ex/ex_pkg.subr @@ -257,7 +257,7 @@ ex_pkg_load_groups() { _eplg_pkg_names=""; for _eplg_fname in $(find ./groups.d -name *.group | sort); do - rtl_fileop source_opt "${_eplg_fname}"; + rtl_fileop source "${_eplg_fname}"; _eplg_group="${_eplg_fname##*/}"; _eplg_group="${_eplg_group%.group}"; @@ -305,6 +305,10 @@ ex_pkg_load_groups() { fi; done; + for _eplg_fname in $(find ./groups.d -mindepth 2 -name *.package | sort); do + rtl_fileop source_with_fnamevar "${_eplg_fname}"; + done; + _eplg_build_groups="$(rtl_uniq "${_eplg_build_groups}")"; eval ${_eplg_rgroups}=\"${_eplg_build_groups}\"; @@ -317,6 +321,33 @@ ex_pkg_load_groups() { }; # +# ex_pkg_register() - register single package +# @_pkg_name: single package name +# @_fname: pathname to file package is defined in, relative to midipix_build root +# @[_group_name]: optional build group name; inferred from @_fname if not specified +# +# Returns: zero (0) on success, non-zero (>0) on failure. +# +ex_pkg_register() { + local _epr_pkg_name="${1}" _epr_fname="${2}" _epr_group_name="${3:-}" \ + _epr_group_name_uc="" _epr_group_noautofl=0; + + if [ "${_epr_group_name:+1}" != 1 ]; then + _epr_group_name="${_epr_fname#./*/}"; + _epr_group_name="${_epr_group_name%%/*}"; + _epr_group_name="${_epr_group_name%.d}"; + _epr_group_name="${_epr_group_name#*.}"; + fi; + + rtl_toupper2 \$_epr_group_name \$_epr_group_name_uc; + rtl_lconcat "\$${_epr_group_name_uc}_PACKAGES" "${_epr_pkg_name}"; + rtl_set_var_unsafe -u "PKG_${_epr_pkg_name}_GROUP" "${_epr_group_name}"; + rtl_set_var_unsafe -u "PKG_${_epr_pkg_name}_GROUP_FNAME" "${_epr_fname}"; + + return 0; +}; + +# # ex_pkg_unfold_depends() - unfold list of package names into dependency-expanded set of complete, disabled, finished, and outstanding package names # @_rdisabled: in reference toout variable of disabled packages # @_rfinished: in reference toout variable of finished packages |