blob: d7c8401128a92155b2c80d238054c089869e044b (
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
33
|
#
# set +o errexit -o noglob -o nounset is assumed.
#
pkg_configure_patch() {
local _patch_cwd="" _patch_dir="${MIDIPIX_BUILD_PWD}/patches" _patch_fname=""\
_patches_done="" _pkg_name_full="${PKG_NAME}${PKG_VERSION:+-${PKG_VERSION}}"\
_strip_count=0;
if [ -n "${PKG_FNAME:-}" ]\
&& [ -n "${PKG_URLS_GIT:-}" ]; then
_patch_cwd="${PKG_BASE_DIR}"; _strip_count=0;
else
_patch_cwd="${PKG_BASE_DIR}/${PKG_SUBDIR}"; _strip_count=1;
fi;
set +o noglob;
for _patch_fname in \
"${_patch_dir}/${_pkg_name}/"*.patch \
"${_patch_dir}/${_pkg_name_full}.local.patch" \
"${_patch_dir}/${_pkg_name_full}.local@${BUILD_HNAME}.patch" \
${PKG_PATCHES_EXTRA:-}; do
if [ -r "${_patch_fname}" ]\
&& ! rtl_lmatch "${_patches_done}" "${_patch_fname}"; then
if ! patch -b -d "${_patch_cwd}" "-p${_strip_count}" < "${_patch_fname}"; then
set -o noglob; return 1;
else
_patches_done="$(rtl_lconcat "${_patches_done}" "${_patch_fname}")";
fi;
fi;
done; set -o noglob;
};
# vim:filetype=sh
|