Infrastructure changes to simplify the conf file.

* Removed the following vars from the conf file: XBPS_BUILDDIR,
  XBPS_PACKAGESDIR and XBPS_SRCDISTDIR. They are always relative
  to XBPS_MASTERDIR and cannot be changed.
* Removed XBPS_INSTALLDIR, it was unused in the code.
* Prepend /tools/bin in PATH for the chroot.
* Don't register a repo in the chroot if the XBPS_PREFER_BINPKG_DEPS
  is not set.

--HG--
extra : convert_revision : 4df03ffa64f0bbf81cd1dd0baf38f1b7e4f47549
This commit is contained in:
Juan RP 2010-04-26 02:51:48 +02:00
parent 7c38045a0f
commit 6673252679
6 changed files with 32 additions and 59 deletions

View file

@ -60,9 +60,6 @@ XBPSSRC_CF=$XBPS_MASTERDIR/usr/local/etc/xbps-src.conf
echo "XBPS_DISTRIBUTIONDIR=/xbps" > $XBPSSRC_CF
echo "XBPS_MASTERDIR=/" >> $XBPSSRC_CF
echo "XBPS_PACKAGESDIR=/xbps_packagesdir" >> $XBPSSRC_CF
echo "XBPS_BUILDDIR=/xbps_builddir" >> $XBPSSRC_CF
echo "XBPS_SRCDISTDIR=/xbps_srcdistdir" >> $XBPSSRC_CF
echo "XBPS_CFLAGS=\"$XBPS_CFLAGS\"" >> $XBPSSRC_CF
echo "XBPS_CXXFLAGS=\"\$XBPS_CFLAGS\"" >> $XBPSSRC_CF
echo "XBPS_FETCH_CMD='xbps-uhelper.static fetch'" >> $XBPSSRC_CF
@ -141,12 +138,18 @@ ff02::2 ip6-allrouters
ff02::3 ip6-allhosts
_EOF
# Create /bin/sh symlink to bash
cd $XBPS_MASTERDIR/bin && ln -sf bash sh
create_binsh_symlink
touch $XBPS_MASTERDIR/.xbps_perms_done
}
create_binsh_symlink()
{
if [ ! -h $XBPS_MASTERDIR/bin/sh ]; then
cd $XBPS_MASTERDIR/bin && ln -sf bash sh
fi
}
prepare_binpkg_repos()
{
if [ ! -f "$XBPS_MASTERDIR/.xbps_added_local_repo" ]; then
@ -206,7 +209,7 @@ xbps_chroot_handler()
local pkg="$2"
local only_destdir="$3"
local norm_builddir="$4"
local path="/usr/local/sbin:/bin::/sbin:/usr/bin:/usr/sbin:/usr/local/bin"
local path="/tools/bin:/usr/local/sbin:/usr/local/bin:/bin:/sbin:/usr/bin:/usr/sbin"
[ -z "$action" -o -z "$pkg" ] && return 1
[ "$action" != "configure" -a "$action" != "build" -a \
@ -218,11 +221,14 @@ xbps_chroot_handler()
echo "done."
fi
create_binsh_symlink
create_busybox_links
install_xbps_utils
${sudo_cmd} @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount
[ $? -ne 0 ] && return $?
prepare_binpkg_repos
if [ -n "$XBPS_PREFER_BINPKG_DEPS" ]; then
prepare_binpkg_repos
fi
# Reinstall xbps-src in the chroot
if [ ! -f $XBPS_MASTERDIR/usr/local/sbin/xbps-src ]; then