diff options
Diffstat (limited to 'subr')
-rw-r--r-- | subr/build_args.subr | 2 | ||||
-rw-r--r-- | subr/ex_pkg_dispatch.subr | 34 | ||||
-rw-r--r-- | subr/ex_pkg_env.subr | 34 | ||||
-rw-r--r-- | subr/ex_pkg_exec.subr | 28 |
4 files changed, 49 insertions, 49 deletions
diff --git a/subr/build_args.subr b/subr/build_args.subr index bf6956fb..6a95b520 100644 --- a/subr/build_args.subr +++ b/subr/build_args.subr @@ -82,7 +82,7 @@ build_args() { while [ ${#} -gt 0 ]; do case "${1}" in *=*) ex_rtl_set_var_unsafe "${1%%=*}" "${1#*=}"; ;; - *) BUILD_TARGETS="${BUILD_TARGETS:+${BUILD_TARGETS} }${1}"; ;; + *) BUILD_GROUPS="${BUILD_GROUPS:+${BUILD_GROUPS} }${1}"; ;; esac; shift; done; }; diff --git a/subr/ex_pkg_dispatch.subr b/subr/ex_pkg_dispatch.subr index ddb78092..8e025532 100644 --- a/subr/ex_pkg_dispatch.subr +++ b/subr/ex_pkg_dispatch.subr @@ -7,40 +7,40 @@ # exp_pkg_dispatch() { - local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}" \ + local _group_name="${1}" _pkg_name="${2}" _restart_at="${3}" \ _dispatch_fn="${4}" _stderrout_path="${5}" _pipe_path="${6}" \ _njobs_vname="${7}" _pkg_name_uc=""; _pkg_name_uc="$(ex_rtl_toupper "${_pkg_name}")"; if [ -n "$(ex_rtl_get_var_unsafe PKG_${_pkg_name_uc}_DISABLED)" ]; then - "${_dispatch_fn}" disabled_pkg "${_pkg_name}" "${_tgt_name}"; + "${_dispatch_fn}" disabled_pkg "${_group_name}" "${_pkg_name}"; elif ex_pkg_state_test "${_pkg_name}" finish\ && [ -z "${_restart_at}" ]; then - "${_dispatch_fn}" skipped_pkg "${_pkg_name}" "${_tgt_name}"; + "${_dispatch_fn}" skipped_pkg "${_group_name}" "${_pkg_name}"; else _stderrout_path="${BUILD_WORKDIR}/${_pkg_name}_stderrout.log"; - "${_dispatch_fn}" start_pkg "${_pkg_name}" "${_tgt_name}"; + "${_dispatch_fn}" start_pkg "${_group_name}" "${_pkg_name}"; (set -o errexit -o noglob; BUILD_IS_PARENT=0; - ex_pkg_env "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; - ex_pkg_exec "${_pkg_name}" "${_tgt_name}" "${_restart_at}" \ + ex_pkg_env "${_group_name}" "${_pkg_name}" "${_restart_at}"; + ex_pkg_exec "${_group_name}" "${_pkg_name}" "${_restart_at}" \ "${_dispatch_fn}";) 1>"${_stderrout_path}" 2>&1 3>"${_pipe_path}" & : $((${_njobs_vname}+=1)); fi; }; ex_pkg_dispatch() { - local _tgt_name="${1}" _restart="${2}" _restart_at="${3}" _dispatch_fn="${4}" _pkgs_found_vname="${5}" \ + local _group_name="${1}" _restart="${2}" _restart_at="${3}" _dispatch_fn="${4}" _pkgs_found_vname="${5}"\ _njob="" _njobs="" _njobs_max="" _pipe_msg="" _pipe_path="" _pkg_names="" _pkgs_found="" \ - _pkgs_found_new="" _script_rc="" _stderrout_path="" _tgt_name_uc=""; + _pkgs_found_new="" _script_rc="" _stderrout_path="" _group_name_uc=""; ex_rtl_fileop mkdir "${BUILD_WORKDIR}"; _pipe_path="${BUILD_WORKDIR}/build.fifo"; - _tgt_name_uc="$(ex_rtl_toupper "${_tgt_name}")"; - "${_dispatch_fn}" start_target "" "${_tgt_name}"; - _pkg_names="$(ex_rtl_get_var_unsafe ${_tgt_name_uc}_PACKAGES)"; + _group_name_uc="$(ex_rtl_toupper "${_group_name}")"; + "${_dispatch_fn}" start_group "${_group_name}" ""; + _pkg_names="$(ex_rtl_get_var_unsafe ${_group_name_uc}_PACKAGES)"; if [ -n "${_restart}" ]\ && ! ex_rtl_lmatch "ALL LAST" " " "${_restart}"; then _pkg_names="$(ex_rtl_lfilter "${_pkg_names}" "${_restart}")"; fi; - if [ "$(ex_rtl_get_var_unsafe ${_tgt_name_uc}_PARALLELISE)" = 1 ]\ + if [ "$(ex_rtl_get_var_unsafe ${_group_name_uc}_PARALLELISE)" = 1 ]\ && [ "${ARG_PARALLEL:-0}" -gt 1 ]; then _njobs_max="${DEFAULT_BUILD_CPUS}"; else @@ -55,9 +55,9 @@ ex_pkg_dispatch() { break; else _pkgs_found_new="${_pkgs_found_new:+${_pkgs_found_new} }${1}"; - exp_pkg_dispatch "${1}" "${_tgt_name}" \ - "${_restart_at}" "${_dispatch_fn}" \ - "${_stderrout_path}" "${_pipe_path}" \ + exp_pkg_dispatch "${_group_name}" "${1}" \ + "${_restart_at}" "${_dispatch_fn}" \ + "${_stderrout_path}" "${_pipe_path}" \ _njobs; shift; fi; done; @@ -72,7 +72,7 @@ ex_pkg_dispatch() { break; else _pkgs_found_new="${_pkgs_found_new:+${_pkgs_found_new} }${1}"; - exp_pkg_dispatch "${1}" "${_tgt_name}" \ + exp_pkg_dispatch "${_group_name}" "${1}" \ "${_restart_at}" "${_dispatch_fn}" \ "${_stderrout_path}" "${_pipe_path}" \ _njobs; shift; @@ -93,7 +93,7 @@ ex_pkg_dispatch() { return "${_script_rc}"; fi; done; - "${_dispatch_fn}" finish_target "" "${_tgt_name}"; + "${_dispatch_fn}" finish_group "${_group_name}" ""; if [ -n "${_pkgs_found_vname}" ]; then _pkgs_found="$(ex_rtl_get_var_unsafe "${_pkgs_found_vname}")"; ex_rtl_set_var_unsafe "${_pkgs_found_vname}" "${_pkgs_found:+${_pkgs_found} }${_pkgs_found_new}"; diff --git a/subr/ex_pkg_env.subr b/subr/ex_pkg_env.subr index bc4f9ce2..cbfb6ecd 100644 --- a/subr/ex_pkg_env.subr +++ b/subr/ex_pkg_env.subr @@ -3,41 +3,41 @@ # exp_pkg_env_source() { - local _pkg_name="${1}" _tgt_name="${2}" \ - _tgt_name_uc="" _pkg_name_uc="" _pkg_name_inherit_uc="" \ + local _group_name="${1}" _pkg_name="${2}" \ + _group_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}")"; + _group_name_uc="$(ex_rtl_toupper "${_group_name}")"; _pkg_name_uc="$(ex_rtl_toupper "${_pkg_name}")"; - ex_rtl_set_vars BUILD_TYPE \ - "DEFAULT ${_tgt_name_uc} PKG_${_pkg_name_uc}" \ + ex_rtl_set_vars BUILD_TYPE \ + "DEFAULT ${_group_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 \ + for _vname_dst in $(ex_rtl_lfilter_not \ "${DEFAULT_BUILD_VARS}" BUILD_TYPE); do 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} \ + ex_rtl_set_vars "${_vname_dst}" \ + "DEFAULT DEFAULT_${_build_type_uc} \ + ${_group_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}" \ + ex_rtl_set_vars "${_vname_dst}" \ + "DEFAULT DEFAULT_${_build_type_uc} \ + ${_group_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)" \ + ex_rtl_unset_vars $(ex_rtl_lfilter_not \ + "$(set | awk -F= '/^PKG_/{print $1}' | sort)" \ "${_vars_set}"); }; ex_pkg_env() { - local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}" _vname=""; - exp_pkg_env_source "${_pkg_name}" "${_tgt_name}"; + local _group_name="${1}" _pkg_name="${2}" _restart_at="${3}" _vname=""; + exp_pkg_env_source "${_group_name}" "${_pkg_name}"; : ${PKG_NAME:="${_pkg_name}"}; : ${MIDIPIX_BUILD_PWD:="$(pwd)"}; : ${PKG_BASE_DIR:="${BUILD_WORKDIR}/${_pkg_name}-${PKG_BUILD_TYPE}-${PKG_TARGET}"}; diff --git a/subr/ex_pkg_exec.subr b/subr/ex_pkg_exec.subr index 7092dad3..0a87b450 100644 --- a/subr/ex_pkg_exec.subr +++ b/subr/ex_pkg_exec.subr @@ -3,12 +3,12 @@ # exp_pkg_exec_pre() { - local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}"; + local _group_name="${1}" _pkg_name="${2}" _restart_at="${3}"; if [ -z "${PKG_URL}" ]\ && [ -z "${PKG_URLS_GIT}" ]\ && [ -z "${PKG_VERSION}" ]\ && ! ex_rtl_test_cmd "pkg_${_pkg_name}_all"; then - "${_dispatch_fn}" exec_missing "${_pkg_name}" "${_tgt_name}"; + "${_dispatch_fn}" exec_missing "${_group_name}" "${_pkg_name}"; return 1; elif ! ex_pkg_state_test "${_pkg_name}" "start" "${_restart_at}"; then if [ "${PKG_NO_CLEAN_BASE_DIR:-0}" -eq 0 ]; then @@ -22,16 +22,16 @@ exp_pkg_exec_pre() { }; ex_pkg_exec() { - local _pkg_name="${1}" _tgt_name="${2}" _restart_at="${3}" \ + local _group_name="${1}" _pkg_name="${2}" _restart_at="${3}" \ _step="" _step_cmd="" _step_cmd_pfx="" _step_rc=""; trap "if [ \${?} -eq 0 ]; then \ - echo \"done ${_pkg_name} ${_tgt_name}\" >&3; \ + echo \"done ${_group_name} ${_pkg_name}\" >&3; \ else \ - echo \"fail ${_pkg_name} ${_tgt_name}\" >&3; \ + echo \"fail ${_group_name} ${_pkg_name}\" >&3; \ pkill -U "${$}"; \ fi;" EXIT HUP INT TERM USR1 USR2; - exp_pkg_exec_pre "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; - "${_dispatch_fn}" exec_start "${_pkg_name}" "${_tgt_name}"; + exp_pkg_exec_pre "${_group_name}" "${_pkg_name}" "${_restart_at}"; + "${_dispatch_fn}" exec_start "${_group_name}" "${_pkg_name}"; if ex_rtl_test_cmd "pkg_${_pkg_name}_all"; then "pkg_${_pkg_name}_all" "${_restart_at}"; else set -- ${PKG_BUILD_STEPS}; @@ -42,25 +42,25 @@ ex_pkg_exec() { continue; else ex_rtl_try_run \ "pkg_${_pkg_name}_${_step}_pre" \ - "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + "${_group_name}" "${_pkg_name}" "${_restart_at}"; if ex_rtl_test_cmd "pkg_${_pkg_name}_${_step}"; then ex_rtl_try_run "pkg_${_pkg_name}_${_step}" \ - "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + "${_group_name}" "${_pkg_name}" "${_restart_at}"; else ex_rtl_try_run "pkg_${_step}" \ - "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + "${_group_name}" "${_pkg_name}" "${_restart_at}"; fi; ex_rtl_try_run \ "pkg_${_pkg_name}_${_step}_post" \ - "${_pkg_name}" "${_tgt_name}" "${_restart_at}"; + "${_group_name}" "${_pkg_name}" "${_restart_at}"; fi; - echo "step ${_pkg_name} ${_tgt_name} ${_step}" >&3; - "${_dispatch_fn}" exec_step "${_pkg_name}" "${_tgt_name}" "${_step}"; + echo "step ${_group_name} ${_pkg_name} ${_step}" >&3; + "${_dispatch_fn}" exec_step "${_group_name}" "${_pkg_name}" "${_step}"; ex_pkg_state_set "${_pkg_name}" "${_step}" "${1:+-${1}}"; done; fi; - "${_dispatch_fn}" exec_finish "${_pkg_name}" "${_tgt_name}"; + "${_dispatch_fn}" exec_finish "${_group_name}" "${_pkg_name}"; ex_pkg_state_set "${_pkg_name}" finish; }; |