From 8101f76f9f63893c2c5775645dab811a2c3a7778 Mon Sep 17 00:00:00 2001 From: maxice8 Date: Sun, 3 Mar 2019 12:45:58 -0300 Subject: [PATCH] meta: rewrite dopatch to use run_step --- common/xbps-src/libexec/xbps-src-dopatch.sh | 39 +++------------------ 1 file changed, 4 insertions(+), 35 deletions(-) diff --git a/common/xbps-src/libexec/xbps-src-dopatch.sh b/common/xbps-src/libexec/xbps-src-dopatch.sh index 7ddfbc6e535..a83acd88a84 100755 --- a/common/xbps-src/libexec/xbps-src-dopatch.sh +++ b/common/xbps-src/libexec/xbps-src-dopatch.sh @@ -30,42 +30,11 @@ if [ -f $XBPS_PATCH_DONE ]; then exit 0 fi -[ -d "$wrksrc" ] && cd "$wrksrc" +for f in $XBPS_COMMONDIR/environment/patch/*.sh; do + source_file "$f" +done -# Run pre-patch hooks -run_pkg_hooks pre-patch - -# If template defines pre_patch(), use it. -if declare -f pre_patch >/dev/null; then - run_func pre_patch -fi - -# If template defines do_patch() use it rather than the build-style. -if declare -f do_patch >/dev/null; then - run_func do_patch -else - if [ -n "$build_style" ]; then - if [ ! -r $XBPS_BUILDSTYLEDIR/${build_style}.sh ]; then - msg_error "$pkgver: cannot find build helper $XBPS_BUILDSTYLEDIR/${build_style}.sh!\n" - fi - . $XBPS_BUILDSTYLEDIR/${build_style}.sh - - if declare -f do_patch >/dev/null; then - run_func do_patch - fi - fi -fi - -# Run do-patch hooks -run_pkg_hooks "do-patch" - -# If template defines post_patch(), use it. -if declare -f post_patch >/dev/null; then - run_func post_patch -fi - -# Run post-patch hooks -run_pkg_hooks post-patch +run_step patch optional touch -f $XBPS_PATCH_DONE