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).
This commit is contained in:
Juan RP 2015-02-28 10:29:27 +01:00
parent 1e0336eaef
commit 8ee4a7c257
2 changed files with 11 additions and 2 deletions

View File

@ -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

View File

@ -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"