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" makejobs="-j$XBPS_MAKEJOBS"
fi 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 if [ -z "$XBPS_DEBUG_PKGS" -o "$repository" = "nonfree" ]; then
nodebug=yes nodebug=yes
fi fi

View file

@ -119,6 +119,9 @@ Options:
-C Do not remove build directory, automatic dependencies and -C Do not remove build directory, automatic dependencies and
package destdir after successful install. 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, -f Force building and registering binary packages into the local repository,
even if same version is already registered. even if same version is already registered.
@ -333,10 +336,11 @@ export XBPS_MACHINE=$(uname -m)
# #
XBPS_OPTIONS= 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 case $opt in
a) readonly XBPS_CROSS_BUILD="$OPTARG"; XBPS_OPTIONS+="-a $OPTARG ";; a) readonly XBPS_CROSS_BUILD="$OPTARG"; XBPS_OPTIONS+="-a $OPTARG ";;
C) readonly XBPS_KEEP_ALL=1; XBPS_OPTIONS+="-C ";; 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 ";; f) readonly XBPS_BUILD_FORCEMODE=1; XBPS_OPTIONS+="-f ";;
G) readonly XBPS_USE_GIT_REVS=1; XBPS_OPTIONS+="-G ";; G) readonly XBPS_USE_GIT_REVS=1; XBPS_OPTIONS+="-G ";;
g) readonly XBPS_DEBUG_PKGS=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_CCACHE XBPS_DISTCC XBPS_DISTCC_HOSTS XBPS_SKIP_DEPS \
XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_PKG_OPTIONS \ XBPS_SKIP_REMOTEREPOS XBPS_CROSS_BUILD XBPS_PKG_OPTIONS \
XBPS_CONFIG_FILE XBPS_KEEP_ALL XBPS_HOSTDIR XBPS_MASTERDIR \ 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 for i in REPOSITORY DESTDIR BUILDDIR SRCDISTDIR; do
eval val="\$XBPS_$i" eval val="\$XBPS_$i"