summaryrefslogtreecommitdiffhomepage
path: root/subr.pkg/pkg_configure_patch_pre.subr
diff options
context:
space:
mode:
authorLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-17 19:29:28 +0100
committerLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-02-17 19:29:28 +0100
commite9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492 (patch)
tree37e46c2578bd8f4f435073db01abc514976da8a8 /subr.pkg/pkg_configure_patch_pre.subr
parent56495632fc8bf612766a9c431e37ff27a903e8c6 (diff)
downloadmidipix_build-e9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492.tar.bz2
midipix_build-e9fa0774ed2e7e030a68f5b0ae51fe6dd69fe492.tar.xz
Make everything a bit faster.
0) Issues several prayers and sacrifices to Enki under threat of a terrible deluge sent down by Ellil 1) Convert fork-write/read exprs to be non-forking 2) Pass mostly everything by reference 3) Don't bother cleaning the variable namespace because Bourne shell is an abomination 4) Removes broken ./pkgtool.sh -s, --restart-at, --update-diff & ./build.sh --dump-{in,on-abort} 5) Cleanup
Diffstat (limited to 'subr.pkg/pkg_configure_patch_pre.subr')
-rw-r--r--subr.pkg/pkg_configure_patch_pre.subr48
1 files changed, 48 insertions, 0 deletions
diff --git a/subr.pkg/pkg_configure_patch_pre.subr b/subr.pkg/pkg_configure_patch_pre.subr
new file mode 100644
index 00000000..54352328
--- /dev/null
+++ b/subr.pkg/pkg_configure_patch_pre.subr
@@ -0,0 +1,48 @@
+#
+# set +o errexit -o noglob -o nounset is assumed.
+#
+
+pkgp_configure_patch_pre() {
+ local _ppcpp_patch_path="";
+
+ for _ppcpp_patch_path in \
+ "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}_pre.local.patch" \
+ "${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}_pre.local@${BUILD_HNAME}.patch";
+ do
+ if [ -r "${_ppcpp_patch_path}" ]\
+ && ! patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_ppcpp_patch_path}";
+ then
+ return 1;
+ fi;
+ done;
+ return 0;
+};
+
+pkgp_configure_patch_pre_chainport() {
+ local _ppcppc_patch_dname="" _ppcppc_patch_fname="" _ppcppc_oldpwd="";
+ _ppcppc_patch_dname="${PKG_BASE_DIR}/${PKG_SUBDIR}/patches/${PKG_NAME%%_ppcppc_*}";
+
+ if [ "${PKG_VERSION:+1}" = 1 ]; then
+ _ppcppc_patch_fname="${BUILD_WORKDIR}/chainport/patches/${PKG_NAME%%_ppcppc_*}/${PKG_NAME%%_ppcppc_*}-${PKG_VERSION}.midipix.patch";
+ fi;
+ if [ -e "${_ppcppc_patch_fname}" ]; then
+ if ! rtl_fileop mkdir "${_ppcppc_patch_dname}"\
+ || ! rtl_fileop cp "${_ppcppc_patch_fname}" "${_ppcppc_patch_dname}"; then
+ return 1;
+ fi;
+ fi;
+ return 0;
+};
+
+pkg_configure_patch_pre() {
+ local _pcpp_group_name="${1}" _pcpp_pkg_name="${2}" _pcpp_restart_at="${3}";
+
+ if ! pkgp_configure_patch_pre_chainport\
+ || ! pkgp_configure_patch_pre;
+ then
+ return 1;
+ fi;
+ return 0;
+};
+
+# vim:filetype=sh