From 08efa2cca12fca6d2820dddea947b67034e86a57 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Thu, 24 Sep 2015 15:45:47 +0200 Subject: [PATCH] xbps-src: -f now works for configure/build/install/pkg phases. --- common/xbps-src/libexec/xbps-src-dobuild.sh | 6 +++--- common/xbps-src/libexec/xbps-src-doconfigure.sh | 6 +++--- common/xbps-src/libexec/xbps-src-doinstall.sh | 10 +++++----- common/xbps-src/libexec/xbps-src-prepkg.sh | 2 +- srcpkgs/xbps/template | 2 +- xbps-src | 4 ++-- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/common/xbps-src/libexec/xbps-src-dobuild.sh b/common/xbps-src/libexec/xbps-src-dobuild.sh index e0f4cfc6824..654f65d50d9 100755 --- a/common/xbps-src/libexec/xbps-src-dobuild.sh +++ b/common/xbps-src/libexec/xbps-src-dobuild.sh @@ -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 [ -f "$XBPS_BUILD_DONE" ]; then +if [ -z "$XBPS_BUILD_FORCEMODE" -a -f $XBPS_BUILD_DONE ]; then exit 0 fi @@ -41,7 +41,7 @@ fi run_pkg_hooks pre-build # Run pre_build() -if [ ! -f $XBPS_PRE_BUILD_DONE ]; then +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 @@ -65,7 +65,7 @@ fi # Run post_build() -if [ ! -f $XBPS_POST_BUILD_DONE ]; then +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 diff --git a/common/xbps-src/libexec/xbps-src-doconfigure.sh b/common/xbps-src/libexec/xbps-src-doconfigure.sh index 8e33ba6fe11..6f408a2eebc 100755 --- a/common/xbps-src/libexec/xbps-src-doconfigure.sh +++ b/common/xbps-src/libexec/xbps-src-doconfigure.sh @@ -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 [ -f "$XBPS_CONFIGURE_DONE" ]; then +if [ -z "$XBPS_BUILD_FORCEMODE" -a -f $XBPS_CONFIGURE_DONE ]; then exit 0 fi @@ -41,7 +41,7 @@ fi run_pkg_hooks pre-configure # Run pre_configure() -if [ ! -f $XBPS_PRECONFIGURE_DONE ]; then +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 @@ -64,7 +64,7 @@ else fi # Run post_configure() -if [ ! -f $XBPS_POSTCONFIGURE_DONE ]; then +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 diff --git a/common/xbps-src/libexec/xbps-src-doinstall.sh b/common/xbps-src/libexec/xbps-src-doinstall.sh index c9c2225bb96..28a6ed01e55 100755 --- a/common/xbps-src/libexec/xbps-src-doinstall.sh +++ b/common/xbps-src/libexec/xbps-src-doinstall.sh @@ -33,13 +33,13 @@ if [ -n "$build_wrksrc" ]; then cd $build_wrksrc || msg_error "$pkgver: cannot access to build_wrksrc [$build_wrksrc]\n" fi -if [ ! -f $XBPS_INSTALL_DONE ]; then +if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_INSTALL_DONE ]; then mkdir -p $XBPS_DESTDIR/$XBPS_CROSS_TRIPLET/$pkgname-$version run_pkg_hooks pre-install # Run pre_install() - if [ ! -f $XBPS_PRE_INSTALL_DONE ]; then + if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_PRE_INSTALL_DONE ]; then if declare -f pre_install >/dev/null; then run_func pre_install touch -f $XBPS_PRE_INSTALL_DONE @@ -47,7 +47,7 @@ if [ ! -f $XBPS_INSTALL_DONE ]; then fi # Run do_install() - if [ ! -f $XBPS_INSTALL_DONE ]; then + if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_INSTALL_DONE ]; then cd "$wrksrc" [ -n "$build_wrksrc" ] && cd $build_wrksrc if declare -f do_install >/dev/null; then @@ -63,7 +63,7 @@ if [ ! -f $XBPS_INSTALL_DONE ]; then fi # Run post_install() - if [ ! -f $XBPS_POST_INSTALL_DONE ]; then + if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -f $XBPS_POST_INSTALL_DONE ]; then cd "$wrksrc" [ -n "$build_wrksrc" ] && cd $build_wrksrc if declare -f post_install >/dev/null; then @@ -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 [ ! -f $XBPS_SUBPKG_INSTALL_DONE ]; then +if [ -z "$XBPS_BUILD_FORCEMODE" -a ! -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 diff --git a/common/xbps-src/libexec/xbps-src-prepkg.sh b/common/xbps-src/libexec/xbps-src-prepkg.sh index 7f6c4ad47bd..4be45fd0a14 100755 --- a/common/xbps-src/libexec/xbps-src-prepkg.sh +++ b/common/xbps-src/libexec/xbps-src-prepkg.sh @@ -27,7 +27,7 @@ done XBPS_PREPKG_DONE="${XBPS_STATEDIR}/${PKGNAME}_${XBPS_CROSS_BUILD}_prepkg_done" -if [ -f $XBPS_PREPKG_DONE ]; then +if [ -z "$XBPS_BUILD_FORCEMODE" -a -f $XBPS_PREPKG_DONE ]; then exit 0 fi diff --git a/srcpkgs/xbps/template b/srcpkgs/xbps/template index 7f0a8bb83c6..a80d4ebe1c7 100644 --- a/srcpkgs/xbps/template +++ b/srcpkgs/xbps/template @@ -29,7 +29,7 @@ fi do_configure() { CFLAGS+=" -Wno-error=redundant-decls" HAVE_VASPRINTF=1 ./configure --prefix=/usr --sysconfdir=/etc --enable-debug \ - --sbindir=/usr/bin ${CHROOT_READY:+--enable-tests} + --bindir=/usr/bin ${CHROOT_READY:+--enable-tests} } post_install() { case "$XBPS_TARGET_MACHINE" in diff --git a/xbps-src b/xbps-src index e044f256287..c8dddf74a4c 100755 --- a/xbps-src +++ b/xbps-src @@ -135,8 +135,8 @@ $(print_cross_targets) -E If a binary package exists in a local repository for the target package, do not try to build it, exit immediately. --f Force building and registering binary packages into the local repository, - even if same version is already registered. +-f Force running the specified stage (configure/build/install/pkg) + even if it ran successfully. -G Enable XBPS_USE_GIT_REVS (see etc/defaults.conf for more information).