e9fa07
#
8d7a8a
# Copyright (c) 2016, 2017, 2018, 2019, 2020, 2021, 2022, 2023 LucĂ­a Andrea Illanes Albornoz <lucia@luciaillanes.de>
e9fa07
# set +o errexit -o noglob -o nounset is assumed.
e9fa07
#
e9fa07
138059
pkg_configure_patch_pre() {
138059
	pkg_configure_patch "${@}" "patches_pre";
138059
};
138059
e9fa07
pkg_configure_patch() {
138059
	local	_pcp_group_name="${1}" _pcp_pkg_name="${2}"		\
138059
		_pcp_restart_at="${3}" _pcp_type="${4:-patches}"	\
138059
		_pcp_patch_cwd="" _pcp_strip_count=0;
e9fa07
e9fa07
	if [ "${PKG_FNAME:+1}" = 1 ]\
e9fa07
	&& [ "${PKG_URLS_GIT:+1}" = 1 ];
e9fa07
	then
e9fa07
		_pcp_patch_cwd="${PKG_BASE_DIR}";
e9fa07
		_pcp_strip_count=0;
e9fa07
	else
e9fa07
		_pcp_patch_cwd="${PKG_BASE_DIR}/${PKG_SUBDIR}";
e9fa07
		_pcp_strip_count=1;
e9fa07
	fi;
e9fa07
138059
	if ! rtl_patch_files						\
138059
		"${_pcp_patch_cwd}" "${_pcp_strip_count}"		\
138059
		ex_pkg_get_default -- --				\
138059
		"${_pcp_pkg_name}" "${PKG_VERSION:-}" "${_pcp_type}";
138059
	then
138059
		return 1;
138059
	fi;
e9fa07
	return 0;
e9fa07
};
e9fa07
64844b
# vim:filetype=sh textwidth=0