Conan_Kudo / build / midipix_build

Forked from build/midipix_build 4 years ago
Clone

Blame subr/pkg_configure_patch.subr

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) 0ddc1e
	local _pkg_name="${PKG_NAME}" _pkg_name_full _patch_dir _patch_fname _patches_done;
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
	if [ -z "${_pkg_name}" ]; then
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
		continue;
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
	else
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
		_pkg_name_full="${_pkg_name}${PKG_VERSION:+-${PKG_VERSION}}";
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
		_patch_dir="${MIDIPIX_BUILD_PWD}/patches";
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
	fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
	set +o noglob; for _patch_fname in 						\
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
			${_patch_dir}/${_pkg_name}/*.patch				\
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
			${_patch_dir}/${_pkg_name_full}.local.patch			\
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
			${_patch_dir}/${_pkg_name_full}.local@${BUILD_HNAME}.patch	\
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
			"${PKG_PATCHES_EXTRA}"; do
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
		if [ -r "${_patch_fname}" ]\
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
		&& ! ex_rtl_lmatch "${_patches_done}" " " "${_patch_fname}"; then
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
			patch -b -d "${PKG_BASE_DIR}/${PKG_SUBDIR}" -p1 < "${_patch_fname}";
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
			_patches_done="${_patches_done:+${_patches_done} }${_patch_fname}";
Lucio Andrés Illanes Albornoz (arab, vxp) 570129
		fi;
Lucio Andrés Illanes Albornoz (arab, vxp) 0ddc1e
	done; 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