summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_patch.subr
blob: 63e1b45071d018be2ba4d536115aae034e695ffa (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#
# set -o errexit -o noglob are assumed.
#

pkg_patch() {
	local _patch_fname;
	if [ -d ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME} ]; then
		set +o noglob;
		for _patch_fname in ${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}/*.patch; do
			patch -b -d ${PKG_SUBDIR} -p1 < ${_patch_fname};
		done;
		set -o noglob;
	fi;
	for _patch_fname in 									\
			${MIDIPIX_BUILD_PWD}/../${PKG_SUBDIR}.local.patch			\
			${MIDIPIX_BUILD_PWD}/../${PKG_SUBDIR}.local@${BUILD_HNAME}.patch	\
			${WORKDIR}/chainport/${PKG_SUBDIR}.midipix.patch			\
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}.local.patch			\
			${MIDIPIX_BUILD_PWD}/patches/${PKG_SUBDIR}.local@${BUILD_HNAME}.patch; do
		if [ -r "${_patch_fname}" ]; then
			patch -b -d ${PKG_SUBDIR} -p1 < ${_patch_fname};
		fi;
	done;
};

# vim:filetype=sh