diff options
-rwxr-xr-x | pkgtool.sh | 2 | ||||
-rw-r--r-- | subr.ex/ex_pkg.subr | 15 | ||||
-rw-r--r-- | subr.ex/ex_pkg_env.subr | 24 | ||||
-rw-r--r-- | vars.dist/dist_gitref.vars (renamed from dist/dist_gitref.dist) | 0 | ||||
-rw-r--r-- | vars.dist/dist_minipix.vars (renamed from dist/dist_minipix.dist) | 0 | ||||
-rw-r--r-- | vars.dist/dist_zipdist.vars (renamed from dist/dist_zipdist.dist) | 0 |
6 files changed, 26 insertions, 15 deletions
@@ -353,7 +353,7 @@ pkgtoolp_info_single() { \$_ppis_fname "${_ppis_patch_idx}" \ "${_ppis_pkg_name}" \ "${_ppis_pkg_version}" \ - "vars_file patches_pre patches" \ + "vars_files patches_pre patches" \ && [ "${_ppis_fname:+1}" = 1 ]; do : $((_ppis_patch_idx += 1)); diff --git a/subr.ex/ex_pkg.subr b/subr.ex/ex_pkg.subr index 3b3bba21..feec47f8 100644 --- a/subr.ex/ex_pkg.subr +++ b/subr.ex/ex_pkg.subr @@ -83,15 +83,15 @@ ex_pkg_find_package() { # @_default_idx: one-based single default value index # @_pkg_name: single package name # @_pkg_version: single package version -# @_ldefault: SP-separated list of default value names (any of: patches, patches_pre, vars_file) +# @_ldefault: SP-separated list of default value names (any of: patches, patches_pre, vars_files) # # Returns: zero (0) on success, non-zero (>0) on invalid default value name or unknown package. # ex_pkg_get_default() { local _epgd_rdefault="${1#\$}" _epgd_default_idx="${2}" _epgd_pkg_name="${3}" \ _epgd_pkg_version="${4}" _epgd_ldefault="${5}" \ - _epgd_default="" _epgd_patch_fname="" _epgd_pkg_name_full="" \ - _epgd_pkg_patches_extra="" _epgd_rc=0; + _epgd_default="" _epgd_group_name="" _epgd_patch_fname="" \ + _epgd_pkg_name_full="" _epgd_pkg_patches_extra="" _epgd_rc=0; set --; _epgd_pkg_name_full="${_epgd_pkg_name}${_epgd_pkg_version:+-${_epgd_pkg_version}}"; @@ -118,9 +118,11 @@ ex_pkg_get_default() { "${MIDIPIX_BUILD_PWD}/patches/${_epgd_pkg_name_full}_pre.local@${BUILD_HNAME}.patch"; ;; - vars_file) - set -- \ - "vars/${_epgd_pkg_name}.vars"; + vars_files) + rtl_get_var_unsafe \$_epgd_group_name -u "PKG_${_epgd_pkg_name}_GROUP"; + set -- \ + "vars/${_epgd_pkg_name}.vars" \ + "vars.${_epgd_group_name}/${_epgd_pkg_name}.vars"; ;; *) @@ -296,6 +298,7 @@ ex_pkg_load_groups() { if [ "${_eplg_group_noautofl}" -eq 0 ]; then for _eplg_pkg_name in ${_eplg_pkg_names}; do + rtl_set_var_unsafe -u "PKG_${_eplg_pkg_name}_GROUP" "${_eplg_group}"; rtl_set_var_unsafe -u "PKG_${_eplg_pkg_name}_GROUP_FNAME" "${_eplg_fname}"; done; fi; diff --git a/subr.ex/ex_pkg_env.subr b/subr.ex/ex_pkg_env.subr index bf5425d7..7c4d7daf 100644 --- a/subr.ex/ex_pkg_env.subr +++ b/subr.ex/ex_pkg_env.subr @@ -117,8 +117,8 @@ ex_pkg_env() { local _epe_build_steps_default="${1}" _epe_build_vars_default="${2}" \ _epe_group_name="${3}" _epe_pkg_name="${4}" _epe_restart_at="${5}" \ _epe_workdir="${6}" \ - _epe_inherit_from="" _epe_pkg_version="" _epe_vars_file="" \ - _epe_vars_file_parent="" _epe_vname=""; + _epe_file_idx=0 _epe_inherit_from="" _epe_pkg_version="" \ + _epe_vars_file="" _epe_vars_file_parent="" _epe_vname=""; if rtl_get_var_unsafe \$_epe_inherit_from -u "PKG_${_epe_pkg_name}_INHERIT_FROM"\ && [ "${_epe_inherit_from:+1}" = 1 ]; then @@ -133,14 +133,22 @@ ex_pkg_env() { if [ "${_epe_vars_file:+1}" != 1 ]; then rtl_get_var_unsafe \$_epe_pkg_version -u "PKG_${_epe_pkg_name}_VERSION"; - ex_pkg_get_default \ - \$_epe_vars_file 1 \ - "${_epe_pkg_name}" "${_epe_pkg_version}" \ - "vars_file" \ - || return 1; + _epe_file_idx=1; + while ex_pkg_get_default \ + \$_epe_vars_file "${_epe_file_idx}" \ + "${_epe_pkg_name}" \ + "${_epe_pkg_version}" \ + "vars_files" \ + && [ "${_epe_vars_file:+1}" = 1 ]; + do + : $((_epe_file_idx += 1)); + rtl_fileop source_opt "${_epe_vars_file}"; + done; + else + rtl_fileop source_opt \ + "${_epe_vars_file}"; fi; - rtl_fileop source_opt "${_epe_vars_file}" "${_epe_group_name}/${_epe_pkg_name}.${_epe_group_name}"; if ! exp_pkg_env_set "${_epe_build_vars_default}" "${_epe_group_name}" "${_epe_pkg_name}"\ || ! exp_pkg_env_defaults "${_epe_build_steps_default}" "${_epe_pkg_name}" "${_epe_workdir}"; then return 1; diff --git a/dist/dist_gitref.dist b/vars.dist/dist_gitref.vars index e1f2152c..e1f2152c 100644 --- a/dist/dist_gitref.dist +++ b/vars.dist/dist_gitref.vars diff --git a/dist/dist_minipix.dist b/vars.dist/dist_minipix.vars index 8d9d330a..8d9d330a 100644 --- a/dist/dist_minipix.dist +++ b/vars.dist/dist_minipix.vars diff --git a/dist/dist_zipdist.dist b/vars.dist/dist_zipdist.vars index 51e8dad0..51e8dad0 100644 --- a/dist/dist_zipdist.dist +++ b/vars.dist/dist_zipdist.vars |