|
Lucio Andrés Illanes Albornoz (arab, vxp) |
1da591 |
#
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
1da591 |
# set -o errexit -o noglob are assumed.
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
1da591 |
#
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
1da591 |
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
32ad21 |
ex_pkg_dispatch() {
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
local _tgt_name="${1}" _pkg_name="${2}" \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
_restart="${3}" _restart_at="${4}" \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
_stdout_path _stderr_path \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
_pipe_path _pipe_path2 _pipe_msg \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
_script_rc=1;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
if ex_pkg_state_test "${_pkg_name}" finish \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
&& [ -z "${_restart}" ] \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
&& [ "${_tgt_name}" != "INVARIANTS" ]; then
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
return 0;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
fc9417 |
else
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
_pipe_path="${WORKDIR}/${_pkg_name}_build.fifo";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
ex_build_fileop rm "${_pipe_path}"; mkfifo "${_pipe_path}";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
_pipe2_path="${WORKDIR}/${_pkg_name}_build2.fifo";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
ex_build_fileop rm "${_pipe2_path}"; mkfifo "${_pipe2_path}";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
_stderr_path="${WORKDIR}/${_pkg_name}_stderr.log";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
_stdout_path="${WORKDIR}/${_pkg_name}_stdout.log";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
ex_build_fileop rm "${_stderr_path}" "${_stdout_path}";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
fc9417 |
fi;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
(set -o errexit -o noglob;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
ex_pkg_vars;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
if [ "${PKG_DISABLED:-0}" -eq 1 ]; then
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
ex_log_msg vnfo "Skipping disabled package \`${PKG_NAME}.'";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
else
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
ex_pkg_env;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
ex_pkg_steps "${_tgt_name}" "${_pkg_name}" \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
"${_restart}" "${_restart_at}";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
fi;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
echo "done ${PKG_BASE_DIR}" >&3; read __ <&4;) \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
61ba13 |
1>"${_stdout_path}" 2>"${_stderr_path}" \
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
fc9417 |
3<>"${_pipe_path}" 4<>"${_pipe2_path}" &
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
while read _pipe_msg <"${_pipe_path}"; do
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
fc9417 |
case "${_pipe_msg%% *}" in
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
fc9417 |
done) echo >"${_pipe2_path}"; _script_rc=0; break; ;;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
fc9417 |
*) break; ;;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
fc9417 |
esac; done;
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
ex_build_fileop rm "${_pipe_path}" "${_pipe2_path}";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
d18b1a |
return "${_script_rc:-1}";
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
1da591 |
};
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
1da591 |
|
|
Lucio Andrés Illanes Albornoz (arab, vxp) |
1da591 |
# vim:filetype=sh
|