summaryrefslogtreecommitdiffhomepage
path: root/subr/ex_pkg_exec.subr
diff options
context:
space:
mode:
authorLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-11 16:09:22 +0000
committerLucio Andrés Illanes Albornoz <lucio@lucioillanes.de>2020-03-11 16:09:22 +0000
commit8a27f992e5b7c62e144dbbfc3435a90c470d92a4 (patch)
tree52aa6aabc1ab3c79a0475bed758828d316180377 /subr/ex_pkg_exec.subr
parentfca18e9d6857d335027d012d462f61ac648ef93a (diff)
downloadmidipix_build-8a27f992e5b7c62e144dbbfc3435a90c470d92a4.tar.bz2
midipix_build-8a27f992e5b7c62e144dbbfc3435a90c470d92a4.tar.xz
Initial implementation of pkgtool.sh.
build.sh:build(): move cd(1) to $(dirname "${0}"). etc/{build.usage,README.md}: updated. midipix.env:${DEFAULT_CLEAR_ENV_VARS_EXCEPT}: allow inheriting ARCH, BUILD, BUILD_DLCACHEDIR, BUILD_WORKDIR, and PREFIX* from the environment. pkgtool.sh: initial implementation. subr/build_init.subr:buildp_init_defaults(): allow inheriting ARCH, BUILD, BUILD_DLCACHEDIR, BUILD_WORKDIR, and PREFIX* from the environment. subr/build_init.subr:buildp_init_env(): move cd(1) to $(dirname "${0}"). subr/build_init.subr:buildp_init_files(): correctly pass ${_status} from rtl_check_path_vars(). subr/ex_pkg_exec.subr:ex_pkg_exec(): dump subset of variables and exported variables on build failure and --dump-on-abort. subr/pkgtool_init.subr: adapted from subr/build_init.subr. subr/rtl_complex.subr:rtl_filter_vars(): initial implementation. subr/rtl_string.subr:rtl_subst(): initial implementation.
Diffstat (limited to 'subr/ex_pkg_exec.subr')
-rw-r--r--subr/ex_pkg_exec.subr20
1 files changed, 20 insertions, 0 deletions
diff --git a/subr/ex_pkg_exec.subr b/subr/ex_pkg_exec.subr
index 9e4629ba..f21bc3d8 100644
--- a/subr/ex_pkg_exec.subr
+++ b/subr/ex_pkg_exec.subr
@@ -2,6 +2,21 @@
# set +o errexit -o noglob is assumed.
#
+exp_pkg_exec_filter_vars_fn() {
+ local _vname="${1}";
+ case "${_vname}" in
+ DEFAULT|PKG_*)
+ return 0; ;;
+ BUILD_DLCACHEDIR|BUILD_WORKDIR|MIDIPIX_BUILD_PWD)
+ return 0; ;;
+ CONFIG_CACHE_GNULIB)
+ return 0; ;;
+ PREFIX|PREFIX_CROSS|PREFIX_MINGW32|PREFIX_MINIPIX|PREFIX_NATIVE|PREFIX_RPM)
+ return 0; ;;
+ *) return 1; ;;
+ esac;
+};
+
#
# exp_pkg_exec_pre() - XXX
# @_group_name: build group name
@@ -102,6 +117,11 @@ ex_pkg_exec() {
|| [ "${_restart_at}" = "ALL" ]; then
ex_pkg_state_set "${_pkg_name}" finish;
fi;
+ elif [ "${_rc:-0}" -ne 0 ]\
+ && [ "${ARG_DUMP_ON_ABORT:-0}" -eq 1 ]; then
+ printf "" > "${BUILD_WORKDIR}/${_pkg_name}.dump";
+ rtl_filter_vars exp_pkg_exec_filter_vars_fn >> "${BUILD_WORKDIR}/${_pkg_name}.dump";
+ export >> "${BUILD_WORKDIR}/${_pkg_name}.dump";
fi;
fi;
return "${_rc}";