diff --git a/xbps-src/shutils/init_funcs.sh.in b/xbps-src/shutils/init_funcs.sh.in index 9f34df5d933..60acbe98aaa 100644 --- a/xbps-src/shutils/init_funcs.sh.in +++ b/xbps-src/shutils/init_funcs.sh.in @@ -27,20 +27,17 @@ set_defvars() { local DDIRS i + XBPS_HELPERSDIR=${XBPS_SHAREDIR}/helpers + XBPS_SHUTILSDIR=${XBPS_SHAREDIR}/shutils + XBPS_COMMONVARSDIR=${XBPS_SHAREDIR}/common XBPS_META_PATH=$XBPS_MASTERDIR/var/db/xbps XBPS_PKGMETADIR=$XBPS_META_PATH/metadata XBPS_SRCPKGDIR=$XBPS_DISTRIBUTIONDIR/srcpkgs if [ -n "$IN_CHROOT" ]; then - XBPS_HELPERSDIR=/usr/local/share/xbps-src/helpers - XBPS_SHUTILSDIR=/usr/local/share/xbps-src/shutils - XBPS_COMMONVARSDIR=/usr/local/share/xbps-src/common XBPS_DESTDIR=/destdir XBPS_BUILDDIR=/builddir else - XBPS_HELPERSDIR=@@XBPS_INSTALL_SHAREDIR@@/helpers - XBPS_SHUTILSDIR=@@XBPS_INSTALL_SHAREDIR@@/shutils - XBPS_COMMONVARSDIR=@@XBPS_INSTALL_SHAREDIR@@/common XBPS_DESTDIR=$XBPS_MASTERDIR/destdir XBPS_BUILDDIR=$XBPS_MASTERDIR/builddir fi diff --git a/xbps-src/xbps-src.sh.in b/xbps-src/xbps-src.sh.in index 42e25fd843d..a5c60cd703e 100644 --- a/xbps-src/xbps-src.sh.in +++ b/xbps-src/xbps-src.sh.in @@ -24,8 +24,16 @@ # THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. #- readonly XBPS_SRC_BUILD_VERSION=20111118 -XBPS_CONFIG_FILE=@@XBPS_INSTALL_ETCDIR@@/xbps-src.conf +if [ -n "$IN_CHROOT" ]; then + export XBPS_ETCDIR=/usr/local/etc/xbps + export XBPS_SHAREDIR=/usr/local/share/xbps-src +else + export XBPS_ETCDIR=@@XBPS_INSTALL_ETCDIR@@ + export XBPS_SHAREDIR=@@XBPS_INSTALL_SHAREDIR@@ +fi + +XBPS_CONFIG_FILE=${XBPS_ETCDIR}/xbps-src.conf PROGNAME=$(basename $0) FAKEROOT_CMD=/usr/bin/fakeroot FAKEROOT_CMD_ARGS="--" @@ -149,7 +157,7 @@ Options: pkg-index is created or updated after a successful package installation. -C Do not remove build directory after successful installation. -c Path to global configuration file: - if not specified @@XBPS_INSTALL_ETCDIR@@/xbps-src.conf is used. + if not specified ${ETCDIR}/xbps-src.conf is used. -D Only install to package's destdir (set to /destdir/- by default). -h Usage output. @@ -281,7 +289,8 @@ check_config_vars if [ -n "${_MASTERDIR}" ]; then export XBPS_MASTERDIR=${_MASTERDIR} fi -. @@XBPS_INSTALL_SHAREDIR@@/shutils/init_funcs.sh +. ${XBPS_SHAREDIR}/shutils/init_funcs.sh + set_defvars for f in $XBPS_SHUTILSDIR/*.sh; do [ -r "$f" ] && . $f @@ -298,7 +307,7 @@ check_reqhost_utils # # Fix up some vars when XBPS_USE_CAPABILITIES is set. # -if [ -n "$XBPS_USE_CAPABILITIES" ]; then +if [ -z "$IN_CHROOT" -a -n "$XBPS_USE_CAPABILITIES" ]; then CHROOT_CMD="@@XBPS_INSTALL_LIBEXECDIR@@/capchroot" unset SUDO_CMD fi