From 8ee4a7c257d07d58cb82d20061af17cf8af52efc Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 28 Feb 2015 10:29:27 +0100 Subject: [PATCH] xbps-src: added -E opt to exit immediately if a binpkg already exists. With -E if there's a binary package in a local repository for the target pkg, exit immediately. This will be used by the upcoming xbps-fbulk(8). --- common/xbps-src/shutils/common.sh | 4 ++++ xbps-src | 9 +++++++-- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/common/xbps-src/shutils/common.sh b/common/xbps-src/shutils/common.sh index 2388501151a..4a159a47198 100644 --- a/common/xbps-src/shutils/common.sh +++ b/common/xbps-src/shutils/common.sh @@ -322,6 +322,10 @@ setup_pkg() { makejobs="-j$XBPS_MAKEJOBS" fi + if [ -n "$XBPS_BINPKG_EXISTS" -a -f "$XBPS_REPOSITORY/${pkgver}.${XBPS_TARGET_MACHINE}.xbps" ]; then + exit 0 + fi + if [ -z "$XBPS_DEBUG_PKGS" -o "$repository" = "nonfree" ]; then nodebug=yes fi diff --git a/xbps-src b/xbps-src index c3c7a0f7543..27e7fa70178 100755 --- a/xbps-src +++ b/xbps-src @@ -119,6 +119,9 @@ Options: -C Do not remove build directory, automatic dependencies and package destdir after successful install. +-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. @@ -333,10 +336,11 @@ export XBPS_MACHINE=$(uname -m) # XBPS_OPTIONS= -while getopts "a:CfgGhH:Ij:Lm:No:r:tV" opt; do +while getopts "a:CEfgGhH:Ij:Lm:No:r:tV" opt; do case $opt in a) readonly XBPS_CROSS_BUILD="$OPTARG"; XBPS_OPTIONS+="-a $OPTARG ";; C) readonly XBPS_KEEP_ALL=1; XBPS_OPTIONS+="-C ";; + E) readonly XBPS_BINPKG_EXISTS=1; XBPS_OPTIONS+=" -E";; f) readonly XBPS_BUILD_FORCEMODE=1; XBPS_OPTIONS+="-f ";; G) readonly XBPS_USE_GIT_REVS=1; XBPS_OPTIONS+="-G ";; g) readonly XBPS_DEBUG_PKGS=1; XBPS_OPTIONS+="-g ";; @@ -494,7 +498,8 @@ export XBPS_SHUTILSDIR XBPS_CROSSPFDIR XBPS_TRIGGERSDIR \ XBPS_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \ XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_PKG_OPTIONS \ XBPS_CONFIG_FILE XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_MASTERDIR \ - XBPS_SRC_VERSION XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR + XBPS_SRC_VERSION XBPS_DESTDIR XBPS_MACHINE XBPS_TEMP_MASTERDIR \ + XBPS_BINPKG_EXISTS for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do eval val="\$XBPS_$i"