xbps-src: use fixed paths for chroot case, unsubst set_defvars.

This commit is contained in:
Juan RP 2011-11-18 12:50:28 +01:00
parent d7c2cc5513
commit c5dd6426ae
2 changed files with 16 additions and 10 deletions

View file

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

View file

@ -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 <pkgname> to package's destdir (set to
<masterdir>/destdir/<pkgname>-<version> 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