meta: rewrite dopatch to use run_step
This commit is contained in:
parent
166b70f35b
commit
8101f76f9f
|
@ -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
|
||||
|
||||
|
|
Loading…
Reference in New Issue