summaryrefslogtreecommitdiffhomepage
path: root/subr.pkg
diff options
context:
space:
mode:
authorLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-03-13 14:18:14 +0100
committerLucía Andrea Illanes Albornoz <lucia@luciaillanes.de>2023-03-13 14:18:14 +0100
commit1380599ef36e89818d74a5e8ee8edd75846a4b7c (patch)
treeb6493f80d2c4784b55ab5bad8c57467b872b98a5 /subr.pkg
parente94dc6d0cadb6703baced36ed82709146e80285b (diff)
downloadmidipix_build-1380599ef36e89818d74a5e8ee8edd75846a4b7c.tar.bz2
midipix_build-1380599ef36e89818d74a5e8ee8edd75846a4b7c.tar.xz
Followup to <fd38dc025f5d31890abbf3d48c597114203b1421>.
Diffstat (limited to 'subr.pkg')
-rw-r--r--subr.pkg/pkg_configure_patch.subr36
l---------[-rw-r--r--]subr.pkg/pkg_configure_patch_pre.subr56
2 files changed, 15 insertions, 77 deletions
diff --git a/subr.pkg/pkg_configure_patch.subr b/subr.pkg/pkg_configure_patch.subr
index 07fb644d..572ea10a 100644
--- a/subr.pkg/pkg_configure_patch.subr
+++ b/subr.pkg/pkg_configure_patch.subr
@@ -3,11 +3,14 @@
# set +o errexit -o noglob -o nounset is assumed.
#
+pkg_configure_patch_pre() {
+ pkg_configure_patch "${@}" "patches_pre";
+};
+
pkg_configure_patch() {
- local _pcp_group_name="${1}" _pcp_pkg_name="${2}" _pcp_restart_at="${3}" \
- _pcp_patch_cwd="" _pcp_patch_dir="${MIDIPIX_BUILD_PWD}/patches" \
- _pcp_patch_fname="" _pcp_patch_idx=0 _pcp_patches_done="" \
- _pcp_strip_count=0;
+ local _pcp_group_name="${1}" _pcp_pkg_name="${2}" \
+ _pcp_restart_at="${3}" _pcp_type="${4:-patches}" \
+ _pcp_patch_cwd="" _pcp_strip_count=0;
if [ "${PKG_FNAME:+1}" = 1 ]\
&& [ "${PKG_URLS_GIT:+1}" = 1 ];
@@ -19,24 +22,13 @@ pkg_configure_patch() {
_pcp_strip_count=1;
fi;
- _pcp_patch_idx=1;
- while ex_pkg_get_default \
- \$_pcp_patch_fname "${_pcp_pkg_name}" \
- "${PKG_VERSION:-}" "patches" "${_pcp_patch_idx}" \
- && [ "${_pcp_patch_fname:+1}" = 1 ];
- do
- : $((_pcp_patch_idx += 1));
- if [ -r "${_pcp_patch_fname}" ]\
- && ! rtl_lmatch \$_pcp_patches_done "${_pcp_patch_fname}";
- then
- if ! patch -b -d "${_pcp_patch_cwd}" "-p${_pcp_strip_count}" < "${_pcp_patch_fname}"; then
- return 1;
- else
- rtl_lconcat \$_pcp_patches_done "${_pcp_patch_fname}";
- fi;
- fi;
- done;
-
+ if ! rtl_patch_files \
+ "${_pcp_patch_cwd}" "${_pcp_strip_count}" \
+ ex_pkg_get_default -- -- \
+ "${_pcp_pkg_name}" "${PKG_VERSION:-}" "${_pcp_type}";
+ then
+ return 1;
+ fi;
return 0;
};
diff --git a/subr.pkg/pkg_configure_patch_pre.subr b/subr.pkg/pkg_configure_patch_pre.subr
index 5f3c8fff..f26702c8 100644..120000
--- a/subr.pkg/pkg_configure_patch_pre.subr
+++ b/subr.pkg/pkg_configure_patch_pre.subr
@@ -1,55 +1 @@
-#
-# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 Lucía Andrea Illanes Albornoz <lucia@luciaillanes.de>
-# set +o errexit -o noglob -o nounset is assumed.
-#
-
-pkgp_configure_patch_pre() {
- local _ppcpp_patch_fname="" _ppcpp_patch_idx=0;
-
- _ppcpp_patch_idx=1;
- while ex_pkg_get_default \
- \$_ppcpp_patch_fname "${PKG_NAME}" \
- "${PKG_VERSION:-}" "patches_pre" "${_ppcpp_patch_idx}" \
- && [ "${_pcp_patch_fname:+1}" = 1 ];
- do
- : $((_ppcpp_patch_idx += 1));
- if [ -r "${_ppcpp_patch_fname}" ]\
- && ! patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_ppcpp_patch_fname}";
- then
- return 1;
- fi;
- done;
- return 0;
-};
-
-pkgp_configure_patch_pre_chainport() {
- local _ppcppc_patch_dname="" _ppcppc_patch_fname="";
-
- ex_pkg_get_default \
- \$_ppcppc_patch_fname "${PKG_NAME}" \
- "${PKG_VERSION:-}" "patches_chainport" 1 \
- || return 1;
-
- if [ "${_ppcppc_patch_fname:+1}" = 1 ]\
- && [ -e "${_ppcppc_patch_fname}" ]; then
- _ppcppc_patch_dname="${PKG_BASE_DIR}/${PKG_SUBDIR}/patches/${PKG_NAME%%_*}";
- 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 textwidth=0
+pkg_configure_patch.subr \ No newline at end of file