xbps-src: repair -f <phase> again; close #2617

Also simplified configure/build/install phases to only touch a single
file once the phase has been run, rather than multiple of them
(pre/post, etc).
This commit is contained in:
Juan RP 2015-09-27 18:48:20 +02:00
parent 3998db0e9c
commit 68701cf6ca
3 changed files with 28 additions and 50 deletions

View File

@ -20,18 +20,17 @@ done
setup_pkg "$PKGNAME" $XBPS_CROSS_BUILD
XBPS_BUILD_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_build_done"
if [ -f $XBPS_BUILD_DONE -a -z "$XBPS_BUILD_FORCEMODE" ] ||
[ -f $XBPS_BUILD_DONE -a -n "$XBPS_BUILD_FORCEMODE" -a $XBPS_TARGET != "build" ]; then
exit 0
fi
for f in $XBPS_COMMONDIR/environment/build/*.sh; do
source_file "$f"
done
XBPS_BUILD_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_build_done"
XBPS_PRE_BUILD_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_pre_build_done"
XBPS_POST_BUILD_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_post_build_done"
if [ -f $XBPS_BUILD_DONE -a $XBPS_TARGET != "build" ] || [ -f $XBPS_BUILD_DONE -a -z "$XBPS_BUILD_FORCEMODE" ]; then
exit 0
fi
cd "$wrksrc" || msg_error "$pkgver: cannot access wrksrc directory [$wrksrc]\n"
if [ -n "$build_wrksrc" ]; then
cd $build_wrksrc || \
@ -41,11 +40,8 @@ fi
run_pkg_hooks pre-build
# Run pre_build()
if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_PRE_BUILD_DONE ]; then
if declare -f pre_build >/dev/null; then
run_func pre_build
touch -f $XBPS_PRE_BUILD_DONE
fi
if declare -f pre_build >/dev/null; then
run_func pre_build
fi
# Run do_build()
@ -65,11 +61,8 @@ fi
# Run post_build()
if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_POST_BUILD_DONE ]; then
if declare -f post_build >/dev/null; then
run_func post_build
touch -f $XBPS_POST_BUILD_DONE
fi
if declare -f post_build >/dev/null; then
run_func post_build
fi
run_pkg_hooks post-build

View File

@ -20,18 +20,17 @@ done
setup_pkg "$PKGNAME" $XBPS_CROSS_BUILD
XBPS_CONFIGURE_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_configure_done"
if [ -f $XBPS_CONFIGURE_DONE -a -z "$XBPS_BUILD_FORCEMODE" ] ||
[ -f $XBPS_CONFIGURE_DONE -a -n "$XBPS_BUILD_FORCEMODE" -a $XBPS_TARGET != "configure" ]; then
exit 0
fi
for f in $XBPS_COMMONDIR/environment/configure/*.sh; do
source_file "$f"
done
XBPS_CONFIGURE_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_configure_done"
XBPS_PRECONFIGURE_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_pre_configure_done"
XBPS_POSTCONFIGURE_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_post_configure_done"
if [ -f $XBPS_CONFIGURE_DONE -a $XBPS_TARGET != "configure" ] || [ -f $XBPS_CONFIGURE_DONE -a -z "$XBPS_BUILD_FORCEMODE" ]; then
exit 0
fi
cd "$wrksrc" || msg_error "$pkgver: cannot access wrksrc directory [$wrksrc].\n"
if [ -n "$build_wrksrc" ]; then
cd $build_wrksrc || \
@ -41,11 +40,8 @@ fi
run_pkg_hooks pre-configure
# Run pre_configure()
if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_PRECONFIGURE_DONE ]; then
if declare -f pre_configure >/dev/null; then
run_func pre_configure
touch -f $XBPS_PRECONFIGURE_DONE
fi
if declare -f pre_configure >/dev/null; then
run_func pre_configure
fi
# Run do_configure()
@ -64,11 +60,8 @@ else
fi
# Run post_configure()
if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_POSTCONFIGURE_DONE ]; then
if declare -f post_configure >/dev/null; then
run_func post_configure
touch -f $XBPS_POSTCONFIGURE_DONE
fi
if declare -f post_configure >/dev/null; then
run_func post_configure
fi
run_pkg_hooks post-configure

View File

@ -27,8 +27,6 @@ for f in $XBPS_COMMONDIR/environment/install/*.sh; do
done
XBPS_INSTALL_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_install_done"
XBPS_PRE_INSTALL_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_pre_install_done"
XBPS_POST_INSTALL_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_post_install_done"
cd "$wrksrc" || msg_error "$pkgver: cannot access to wrksrc [$wrksrc]\n"
if [ -n "$build_wrksrc" ]; then
@ -42,11 +40,8 @@ if [ "$SUBPKG_MODE" = "no" ]; then
run_pkg_hooks pre-install
# Run pre_install()
if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then
if declare -f pre_install >/dev/null; then
run_func pre_install
touch -f $XBPS_PRE_INSTALL_DONE
fi
if declare -f pre_install >/dev/null; then
run_func pre_install
fi
# Run do_install()
@ -64,13 +59,10 @@ if [ "$SUBPKG_MODE" = "no" ]; then
touch -f $XBPS_INSTALL_DONE
# Run post_install()
if [ ! -f $XBPS_POST_INSTALL_DONE ]; then
cd "$wrksrc"
[ -n "$build_wrksrc" ] && cd $build_wrksrc
if declare -f post_install >/dev/null; then
run_func post_install
touch -f $XBPS_POST_INSTALL_DONE
fi
cd "$wrksrc"
[ -n "$build_wrksrc" ] && cd $build_wrksrc
if declare -f post_install >/dev/null; then
run_func post_install
fi
fi
exit 0