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) 570129
pkg_patch() {
Lucio Andrés Illanes Albornoz (arab, vxp) e49766
	local _patch_fname _patches_done;
Lucio Andrés Illanes Albornoz (arab, vxp) e49766
	set +o noglob;
Lucio Andrés Illanes Albornoz (arab, vxp) d5afb4
	for _patch_fname in 										\
Lucio Andrés Illanes Albornoz (arab, vxp) cc101d
			${WORKDIR}/chainport/${PKG_NAME}.midipix.patch					\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${WORKDIR}/chainport/${PKG_SUBDIR}.midipix.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${WORKDIR}/chainport/${PKG_SUBDIR%-*}.midipix.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) cc101d
			${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}/*.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}/*.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}/*.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) cc101d
			${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}.local.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}.local.patch			\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}.local@${BUILD_HNAME}.patch		\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}.local@${BUILD_HNAME}.patch		\
Lucio Andrés Illanes Albornoz (arab, vxp) c2b35f
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR%-*}.local@${BUILD_HNAME}.patch; do
Lucio Andrés Illanes Albornoz (arab, vxp) e49766
		if ! lmatch "${_patches_done}" " " "${_patch_fname}"\
Lucio Andrés Illanes Albornoz (arab, vxp) e49766
		&& [ -r "${_patch_fname}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) d5afb4
			patch -b -d "${WORKDIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}";
Lucio Andrés Illanes Albornoz (arab, vxp) e49766
			_patches_done="${_patches_done:+${_patches_done} }${_patch_fname}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 802215
	done;
Lucio Andrés Illanes Albornoz (arab, vxp) e49766
	set -o noglob;
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