summaryrefslogtreecommitdiffhomepage
path: root/subr/pkg_configure_patch_pre.subr
blob: 1c572efdf3e6f0fc04506b40c23d1a64a54da69f (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
27
28
29
30
31
32
#
# set +o errexit -o noglob is assumed.
#

pkgp_configure_patch_pre() {
	local _patch_path="";
	for _patch_path in \
			"${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}_pre.local.patch"		\
			"${MIDIPIX_BUILD_PWD}/patches/${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}_pre.local@${BUILD_HNAME}.patch"; do
		if [ -r "${_patch_path}" ]; then
			patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_path}" || return "${?}";
		fi;
	done;
};

pkgp_configure_patch_pre_chainport() {
	local	_chainport_patch_fname="${BUILD_WORKDIR}/chainport/patches/${PKG_NAME%%_*}/${PKG_NAME%%_*}-${PKG_VERSION}.midipix.patch"\
		_chainport_patch_dname="${PKG_BASE_DIR}/${PKG_SUBDIR}/patches/${PKG_NAME%%_*}" _oldpwd="";
	if [ -e "${_chainport_patch_fname}" ]; then
		rtl_fileop mkdir "${_chainport_patch_dname}" || return "${?}";
		rtl_fileop cp "${_chainport_patch_fname}" "${_chainport_patch_dname}" || return "${?}";
	fi;
};

pkg_configure_patch_pre() {
	if ! pkgp_configure_patch_pre_chainport\
	|| ! pkgp_configure_patch_pre; then
		return 1;
	fi;
};

# vim:filetype=sh