From 2c26b0870a0cdcf05e2333aa80515f8e4e148804 Mon Sep 17 00:00:00 2001 From: Yamashita Yuu Date: Wed, 15 Jan 2014 17:20:41 +0900 Subject: [PATCH] Setup built-in patches out from stub functions of `{before,after}_install_package}. --- plugins/python-build/bin/python-build | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/plugins/python-build/bin/python-build b/plugins/python-build/bin/python-build index 2dd8fc0b..b0324144 100755 --- a/plugins/python-build/bin/python-build +++ b/plugins/python-build/bin/python-build @@ -165,9 +165,11 @@ make_package() { shift pushd "$package_name" >&4 + setup_builtin_patches "$package_name" before_install_package "$package_name" build_package "$package_name" $* after_install_package "$package_name" + cleanup_builtin_patches "$package_name" fix_directory_permissions popd >&4 } @@ -699,10 +701,13 @@ build_package_copy() { before_install_package() { local stub=1 - before_install_package_patch "$@" } -before_install_package_patch() { +after_install_package() { + local stub=1 +} + +setup_builtin_patches() { local package_name="$1" local package_patch_path="${PYTHON_BUILD_ROOT}/share/python-build/patches/${DEFINITION_PATH##*/}/${package_name}" @@ -713,19 +718,14 @@ before_install_package_patch() { { for patch in "${package_patch_path}"/*; do [ -f "${patch}" ] && echo "${patch}" done - } | sort | xargs cat -- 1>"${package_name}.patch" + } 2>/dev/null | sort | xargs cat 1>"${package_name}.patch" exec <&- exec <"${package_name}.patch" HAS_PATCH=true fi } -after_install_package() { - local stub=1 - after_install_package_patch "$@" -} - -after_install_package_patch() { +cleanup_builtin_patches() { local package_name="$1" rm -f "${package_name}.patch" HAS_PATCH="$ORIG_HAS_PATCH"