Remove PACKAGE_PATCH_STRIP. Use PACKAGE_PATCH_OPTS instead.

This commit is contained in:
Yamashita Yuu 2013-12-26 14:01:46 +09:00
parent 5bff9c773a
commit 35d4cd2259

View file

@ -163,23 +163,26 @@ install_package_using() {
apply_patches() {
local package_name="$1"
# Support PYTHON_PATCH_STRIP, etc.
# Support PYTHON_PATCH_PATH, PYTHON_PATCH_OPTS, etc.
local package_var_name="$(capitalize "${package_name%%-*}")"
local PACKAGE_PATCH="${package_var_name}_PATCH"
local PACKAGE_PATCH_PATH="${package_var_name}_PATCH_PATH"
local PACKAGE_PATCH_STRIP="${package_var_name}_PATCH_STRIP"
local PACKAGE_PATCH_OPTS="${package_var_name}_PATCH_OPTS"
local PACKAGE_PATCH_OPTS_ARRAY="${package_var_name}_PATCH_OPTS_ARRAY[@]"
if [ -z "${PATCH_OPTS+defined}" ] && [ "${!PACKAGE_PATCH_OPTS+defined}" ]; then
local PATCH_OPTS="-p0"
fi
local patch_path="${!PACKAGE_PATCH_PATH:-${PYTHON_BUILD_PATCH_PATH}/${package_name}}"
# path may be given in relative from working directory
[ -e "${patch_path}" ] || patch_path="${CWD}/${patch_path}"
# FIXME: patches should be sorted in their names
local patch
for patch in "${patch_path}"/*; do
if [ -f "$patch" ]; then
echo "Applying ${patch##*/} to ${package_name}..." >&2
{ ${!PACKAGE_PATCH:-patch} "-p${!PACKAGE_PATCH_STRIP:-0}" $PATCH_OPTS ${!PACKAGE_PATCH_OPTS} "${!PACKAGE_PATCH_OPTS_ARRAY}" < "$patch"
{ ${!PACKAGE_PATCH:-patch} $PATCH_OPTS ${!PACKAGE_PATCH_OPTS} < "$patch"
} >&4 2>&1
fi
done