Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
# set -o errexit -o noglob are assumed.
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
#
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) c27bea
pkg_configure_patch() {
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	local _pkg_name _pkg_name_full _patch_dir _patch_fname _patches_done;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
	for _pkg_name in "${PKG_NAME}" "${PKG_NAME_PARENT}"; do
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		if [ -z "${_pkg_name}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			continue;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		else
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			_pkg_name_full="${_pkg_name}${PKG_VERSION:+-${PKG_VERSION}}";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			_patch_dir="${MIDIPIX_BUILD_PWD}/patches";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		set +o noglob; for _patch_fname in 						\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
				${_patch_dir}/${_pkg_name}/*.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
				${_patch_dir}/${_pkg_name_full}.local.patch			\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
				${_patch_dir}/${_pkg_name_full}.local@${BUILD_HNAME}.patch	\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
				"${PKG_PATCHES_EXTRA}"; do
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			if [ -r "${_patch_fname}" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			&& ! ex_rtl_lmatch "${_patches_done}" " " "${_patch_fname}"; then
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
				patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
				_patches_done="${_patches_done:+${_patches_done} }${_patch_fname}";
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
			fi;
Lucio Andrés Illanes Albornoz (arab, vxp) ec19f0
		done; set -o noglob;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	done;
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
};
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
# vim:filetype=sh