xbps-src: make -f <phase> respect previous successful phases.
This commit is contained in:
parent
08efa2cca1
commit
4449fbd0be
|
@ -15,11 +15,13 @@ if [ $# -lt 3 -o $# -gt 5 ]; then
|
|||
fi
|
||||
|
||||
readonly PKGNAME="$1"
|
||||
readonly TARGET_PKG="$2"
|
||||
readonly TARGET="$3"
|
||||
readonly XBPS_TARGET_PKG="$2"
|
||||
readonly XBPS_TARGET="$3"
|
||||
readonly XBPS_CROSS_BUILD="$4"
|
||||
readonly XBPS_CROSS_PREPARE="$5"
|
||||
|
||||
export XBPS_TARGET
|
||||
|
||||
for f in $XBPS_SHUTILSDIR/*.sh; do
|
||||
. $f
|
||||
done
|
||||
|
@ -38,26 +40,26 @@ if [ -z "$XBPS_DEPENDENCY" -a -z "$XBPS_TEMP_MASTERDIR" -a -n "$XBPS_KEEP_ALL" -
|
|||
remove_pkg_autodeps
|
||||
fi
|
||||
# Install dependencies from binary packages
|
||||
if [ "$PKGNAME" != "$TARGET_PKG" -o -z "$XBPS_SKIP_DEPS" ]; then
|
||||
install_pkg_deps $PKGNAME $TARGET_PKG pkg $XBPS_CROSS_BUILD $XBPS_CROSS_PREPARE || exit $?
|
||||
if [ "$PKGNAME" != "$XBPS_TARGET_PKG" -o -z "$XBPS_SKIP_DEPS" ]; then
|
||||
install_pkg_deps $PKGNAME $XBPS_TARGET_PKG pkg $XBPS_CROSS_BUILD $XBPS_CROSS_PREPARE || exit $?
|
||||
fi
|
||||
|
||||
# Fetch distfiles after installing required dependencies,
|
||||
# because some of them might be required for do_fetch().
|
||||
$XBPS_LIBEXECDIR/xbps-src-dofetch.sh $SOURCEPKG $XBPS_CROSS_BUILD || exit 1
|
||||
[ "$TARGET" = "fetch" ] && exit 0
|
||||
[ "$XBPS_TARGET" = "fetch" ] && exit 0
|
||||
|
||||
# Fetch, extract, build and install into the destination directory.
|
||||
$XBPS_LIBEXECDIR/xbps-src-doextract.sh $SOURCEPKG $XBPS_CROSS_BUILD || exit 1
|
||||
[ "$TARGET" = "extract" ] && exit 0
|
||||
[ "$XBPS_TARGET" = "extract" ] && exit 0
|
||||
|
||||
# Run configure phase
|
||||
$XBPS_LIBEXECDIR/xbps-src-doconfigure.sh $SOURCEPKG $XBPS_CROSS_BUILD || exit 1
|
||||
[ "$TARGET" = "configure" ] && exit 0
|
||||
[ "$XBPS_TARGET" = "configure" ] && exit 0
|
||||
|
||||
# Run build phase
|
||||
$XBPS_LIBEXECDIR/xbps-src-dobuild.sh $SOURCEPKG $XBPS_CROSS_BUILD || exit 1
|
||||
[ "$TARGET" = "build" ] && exit 0
|
||||
[ "$XBPS_TARGET" = "build" ] && exit 0
|
||||
|
||||
# Install pkgs into destdir.
|
||||
$XBPS_LIBEXECDIR/xbps-src-doinstall.sh $SOURCEPKG $XBPS_CROSS_BUILD || exit 1
|
||||
|
@ -70,7 +72,7 @@ for subpkg in ${subpackages} ${sourcepkg}; do
|
|||
done
|
||||
|
||||
for subpkg in ${subpackages} ${sourcepkg}; do
|
||||
if [ "$PKGNAME" = "${subpkg}" -a "$TARGET" = "install" ]; then
|
||||
if [ "$PKGNAME" = "${subpkg}" -a "$XBPS_TARGET" = "install" ]; then
|
||||
exit 0
|
||||
fi
|
||||
done
|
||||
|
|
|
@ -28,7 +28,7 @@ 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 [ -z "$XBPS_BUILD_FORCEMODE" -a -f $XBPS_BUILD_DONE ]; then
|
||||
if [ -f $XBPS_BUILD_DONE -a $XBPS_TARGET != "build" ] || [ -f $XBPS_BUILD_DONE -a -z "$XBPS_BUILD_FORCEMODE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ XBPS_CONFIGURE_DONE="${XBPS_STATEDIR}/${sourcepkg}_${XBPS_CROSS_BUILD}_configure
|
|||
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 [ -z "$XBPS_BUILD_FORCEMODE" -a -f $XBPS_CONFIGURE_DONE ]; then
|
||||
if [ -f $XBPS_CONFIGURE_DONE -a $XBPS_TARGET != "configure" ] || [ -f $XBPS_CONFIGURE_DONE -a -z "$XBPS_BUILD_FORCEMODE" ]; then
|
||||
exit 0
|
||||
fi
|
||||
|
||||
|
|
|
@ -33,7 +33,7 @@ if [ -n "$build_wrksrc" ]; then
|
|||
cd $build_wrksrc || msg_error "$pkgver: cannot access to build_wrksrc [$build_wrksrc]\n"
|
||||
fi
|
||||
|
||||
if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_INSTALL_DONE ]; then
|
||||
if [ ! -f $XBPS_INSTALL_DONE -a $XBPS_TARGET != "install" ] || [ ! -f $XBPS_INSTALL_DONE -a -z "$XBPS_BUILD_FORCEMODE" ]; then
|
||||
mkdir -p $XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/$pkgname-$version
|
||||
|
||||
run_pkg_hooks pre-install
|
||||
|
@ -77,7 +77,7 @@ fi
|
|||
XBPS_SUBPKG_INSTALL_DONE="${XBPS_STATEDIR}/${PKGNAME}_${XBPS_CROSS_BUILD}_subpkg_install_done"
|
||||
|
||||
# If it's a subpkg execute the pkg_install() function.
|
||||
if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_SUBPKG_INSTALL_DONE ]; then
|
||||
if [ ! -f $XBPS_SUBPKG_INSTALL_DONE ]; then
|
||||
if [ "$sourcepkg" != "$PKGNAME" ]; then
|
||||
# Source all subpkg environment setup snippets.
|
||||
for f in ${XBPS_COMMONDIR}/environment/setup-subpkg/*.sh; do
|
||||
|
|
Loading…
Reference in New Issue