From 8bc23145c8ad491a63919d449f68585f70f14b11 Mon Sep 17 00:00:00 2001 From: Juan RP Date: Sat, 2 Jul 2011 22:56:26 +0200 Subject: [PATCH] xbps-src: added -S flag to disable XBPS_PREFER_BINPKG_DEPS. --- xbps-src/shutils/chroot.sh.in | 11 ++++------- xbps-src/shutils/pkgtarget_funcs.sh.in | 2 +- xbps-src/xbps-src.sh.in | 23 +++++++++++++---------- 3 files changed, 18 insertions(+), 18 deletions(-) diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index 87fd5c1437c..395c8b97729 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -271,7 +271,7 @@ install_xbps_utils() xbps_chroot_handler() { - local action="$1" pkg="$2" norm_builddir="$3" rv=0 + local action="$1" pkg="$2" keep_wrksrc="$3" rv=0 local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin" [ -z "$action" -o -z "$pkg" ] && return 1 @@ -313,15 +313,12 @@ xbps_chroot_handler() if [ "$action" = "chroot" ]; then env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \ - ${chroot_cmd} $XBPS_MASTERDIR /bin/sh || \ - rv=$? + ${chroot_cmd} $XBPS_MASTERDIR /bin/sh || rv=$? else - [ "$norm_builddir" = "yes" ] && \ - action="-C $action" + [ -n "$keep_wrksrc" ] && action="-C $action" env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \ ${chroot_cmd} $XBPS_MASTERDIR sh -c \ - "cd /xbps/srcpkgs/$pkg && xbps-src $action" || \ - rv=$? + "cd /xbps/srcpkgs/$pkg && xbps-src $action" || rv=$? fi msg_normal "Exiting from the chroot on $XBPS_MASTERDIR.\n" diff --git a/xbps-src/shutils/pkgtarget_funcs.sh.in b/xbps-src/shutils/pkgtarget_funcs.sh.in index b93ae396cc9..4dc201f95df 100644 --- a/xbps-src/shutils/pkgtarget_funcs.sh.in +++ b/xbps-src/shutils/pkgtarget_funcs.sh.in @@ -153,7 +153,7 @@ install_pkg() # # Remove $wrksrc if -C not specified. # - if [ -d "$wrksrc" -a "$dontrm_builddir" = "no" ]; then + if [ -d "$wrksrc" -a -z "$KEEP_WRKSRC" ]; then remove_tmpl_wrksrc $wrksrc fi diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index c24d2f87bf8..9cba6d76e3e 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -52,7 +52,7 @@ check_reqhost_utils() usage() { cat << _EOF -$progname: [-Ch] [-c ] [-m ] [-p ] [-s ] +$progname: [-ChS] [-c ] [-m ] [-p ] [-s ] [] Targets: bootstrap Build and install the bootstrap packages into . @@ -92,9 +92,12 @@ Options: if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used. -h Usage output. -m Master directory, overwritting the value set in the configuration - file at @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf. + file xbps-src.conf. -p Package directory, overwritting default path at /pkg-binpkgs. + -S Overrides and disables XBPS_PREFER_BINPKG_DEPS even if it was + set in the configuration file xbps-src.conf. + it was set in the configuration file. -s Source distribution files directory, overwritting default path at /pkg-srcdistdir. @@ -168,9 +171,9 @@ check_config_vars() # # main() # -while getopts "Cc:hm:p:s:" opt; do +while getopts "Cc:hm:p:Ss:" opt; do case $opt in - C) export dontrm_builddir=yes;; + C) KEEP_WRKSRC=1;; c) XBPS_CONFIG_FILE="$OPTARG";; h) usage && exit 0;; m) @@ -187,6 +190,7 @@ while getopts "Cc:hm:p:s:" opt; do mkdir -p ${_PACKAGEDIR}/noarch fi ;; + S) UNSET_PREFER_BINPKG_DEPS=1;; s) export XBPS_SRCDISTDIR="$OPTARG";; --) shift; break;; esac @@ -221,6 +225,9 @@ for f in $(echo @@XBPS_INSTALL_SHAREDIR@@/shutils/*.sh); do fi done +# Disable XBPS_PREFER_BINPKG_DEPS if requested. +[ -n "$UNSET_PREFER_BINPKG_DEPS" ] && unset XBPS_PREFER_BINPKG_DEPS + # # Check for required utilities in host system. # @@ -244,8 +251,6 @@ if [ "$(id -u)" -eq 0 ]; then fi fi -[ -z "$dontrm_builddir" ] && dontrm_builddir=no - # # Sanitize PATH. # @@ -275,7 +280,6 @@ bootstrap) setup_tmpl ${_ORIGINPKG} && install_pkg $pkgname ;; build|configure) - . $XBPS_SHUTILSDIR/tmpl_funcs.sh if [ -z "${_pkgname}" ]; then [ ! -r ./template ] && msg_error "missing build template in $(pwd).\n" . ./template @@ -371,7 +375,7 @@ install|install-destdir) _ORIGINPKG="${_pkgname}" if [ -z "$in_chroot" -a -z "$base_chroot" ]; then . $XBPS_SHUTILSDIR/chroot.sh - xbps_chroot_handler $target ${_ORIGINPKG} $dontrm_builddir + xbps_chroot_handler $target ${_ORIGINPKG} $KEEP_WRKSRC else setup_tmpl ${_ORIGINPKG} install_pkg $pkgname @@ -403,7 +407,7 @@ remove) setup_tmpl ${_pkgname} if [ -z "$in_chroot" -a -z "$base_chroot" ]; then . $XBPS_SHUTILSDIR/chroot.sh - xbps_chroot_handler $target ${_pkgname} $dontrm_builddir + xbps_chroot_handler $target ${_pkgname} $KEEP_WRKSRC else remove_pkg fi @@ -418,7 +422,6 @@ stow) stow_pkg_handler stow ;; unstow) - . $XBPS_SHUTILSDIR/tmpl_funcs.sh if [ -z "${_pkgname}" ]; then [ ! -r ./template ] && msg_error "missing build template in $(pwd).\n" _pkgname=$(basename_cwd)