xbps-src: added -S flag to disable XBPS_PREFER_BINPKG_DEPS.

This commit is contained in:
Juan RP 2011-07-02 22:56:26 +02:00
parent c124ec1bef
commit 8bc23145c8
3 changed files with 18 additions and 18 deletions

View file

@ -271,7 +271,7 @@ install_xbps_utils()
xbps_chroot_handler() 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" local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
[ -z "$action" -o -z "$pkg" ] && return 1 [ -z "$action" -o -z "$pkg" ] && return 1
@ -313,15 +313,12 @@ xbps_chroot_handler()
if [ "$action" = "chroot" ]; then if [ "$action" = "chroot" ]; then
env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \ env in_chroot=yes IN_CHROOT=1 LANG=C PATH=$path \
${chroot_cmd} $XBPS_MASTERDIR /bin/sh || \ ${chroot_cmd} $XBPS_MASTERDIR /bin/sh || rv=$?
rv=$?
else else
[ "$norm_builddir" = "yes" ] && \ [ -n "$keep_wrksrc" ] && action="-C $action"
action="-C $action"
env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \ env in_chroot=yes LANG=C PATH=$path _ORIGINPKG="$pkg" \
${chroot_cmd} $XBPS_MASTERDIR sh -c \ ${chroot_cmd} $XBPS_MASTERDIR sh -c \
"cd /xbps/srcpkgs/$pkg && xbps-src $action" || \ "cd /xbps/srcpkgs/$pkg && xbps-src $action" || rv=$?
rv=$?
fi fi
msg_normal "Exiting from the chroot on $XBPS_MASTERDIR.\n" msg_normal "Exiting from the chroot on $XBPS_MASTERDIR.\n"

View file

@ -153,7 +153,7 @@ install_pkg()
# #
# Remove $wrksrc if -C not specified. # 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 remove_tmpl_wrksrc $wrksrc
fi fi

View file

@ -52,7 +52,7 @@ check_reqhost_utils()
usage() usage()
{ {
cat << _EOF cat << _EOF
$progname: [-Ch] [-c <file>] [-m <dir>] [-p <dir>] [-s <dir>] <target> $progname: [-ChS] [-c <file>] [-m <dir>] [-p <dir>] [-s <dir>] <target> [<pkgname>]
Targets: Targets:
bootstrap Build and install the bootstrap packages into <masterdir>. bootstrap Build and install the bootstrap packages into <masterdir>.
@ -92,9 +92,12 @@ Options:
if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used. if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used.
-h Usage output. -h Usage output.
-m Master directory, overwritting the value set in the configuration -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 -p Package directory, overwritting default path at
<masterdir>/pkg-binpkgs. <masterdir>/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 -s Source distribution files directory, overwritting default path at
<masterdir>/pkg-srcdistdir. <masterdir>/pkg-srcdistdir.
@ -168,9 +171,9 @@ check_config_vars()
# #
# main() # main()
# #
while getopts "Cc:hm:p:s:" opt; do while getopts "Cc:hm:p:Ss:" opt; do
case $opt in case $opt in
C) export dontrm_builddir=yes;; C) KEEP_WRKSRC=1;;
c) XBPS_CONFIG_FILE="$OPTARG";; c) XBPS_CONFIG_FILE="$OPTARG";;
h) usage && exit 0;; h) usage && exit 0;;
m) m)
@ -187,6 +190,7 @@ while getopts "Cc:hm:p:s:" opt; do
mkdir -p ${_PACKAGEDIR}/noarch mkdir -p ${_PACKAGEDIR}/noarch
fi fi
;; ;;
S) UNSET_PREFER_BINPKG_DEPS=1;;
s) export XBPS_SRCDISTDIR="$OPTARG";; s) export XBPS_SRCDISTDIR="$OPTARG";;
--) shift; break;; --) shift; break;;
esac esac
@ -221,6 +225,9 @@ for f in $(echo @@XBPS_INSTALL_SHAREDIR@@/shutils/*.sh); do
fi fi
done 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. # Check for required utilities in host system.
# #
@ -244,8 +251,6 @@ if [ "$(id -u)" -eq 0 ]; then
fi fi
fi fi
[ -z "$dontrm_builddir" ] && dontrm_builddir=no
# #
# Sanitize PATH. # Sanitize PATH.
# #
@ -275,7 +280,6 @@ bootstrap)
setup_tmpl ${_ORIGINPKG} && install_pkg $pkgname setup_tmpl ${_ORIGINPKG} && install_pkg $pkgname
;; ;;
build|configure) build|configure)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
if [ -z "${_pkgname}" ]; then if [ -z "${_pkgname}" ]; then
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n" [ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
. ./template . ./template
@ -371,7 +375,7 @@ install|install-destdir)
_ORIGINPKG="${_pkgname}" _ORIGINPKG="${_pkgname}"
if [ -z "$in_chroot" -a -z "$base_chroot" ]; then if [ -z "$in_chroot" -a -z "$base_chroot" ]; then
. $XBPS_SHUTILSDIR/chroot.sh . $XBPS_SHUTILSDIR/chroot.sh
xbps_chroot_handler $target ${_ORIGINPKG} $dontrm_builddir xbps_chroot_handler $target ${_ORIGINPKG} $KEEP_WRKSRC
else else
setup_tmpl ${_ORIGINPKG} setup_tmpl ${_ORIGINPKG}
install_pkg $pkgname install_pkg $pkgname
@ -403,7 +407,7 @@ remove)
setup_tmpl ${_pkgname} setup_tmpl ${_pkgname}
if [ -z "$in_chroot" -a -z "$base_chroot" ]; then if [ -z "$in_chroot" -a -z "$base_chroot" ]; then
. $XBPS_SHUTILSDIR/chroot.sh . $XBPS_SHUTILSDIR/chroot.sh
xbps_chroot_handler $target ${_pkgname} $dontrm_builddir xbps_chroot_handler $target ${_pkgname} $KEEP_WRKSRC
else else
remove_pkg remove_pkg
fi fi
@ -418,7 +422,6 @@ stow)
stow_pkg_handler stow stow_pkg_handler stow
;; ;;
unstow) unstow)
. $XBPS_SHUTILSDIR/tmpl_funcs.sh
if [ -z "${_pkgname}" ]; then if [ -z "${_pkgname}" ]; then
[ ! -r ./template ] && msg_error "missing build template in $(pwd).\n" [ ! -r ./template ] && msg_error "missing build template in $(pwd).\n"
_pkgname=$(basename_cwd) _pkgname=$(basename_cwd)