xbps-src: no need to chroot to install xbps-src anymore.

This commit is contained in:
Juan RP 2011-11-18 15:41:49 +01:00
parent 99578ee070
commit 7253423d23
3 changed files with 27 additions and 17 deletions

View file

@ -270,13 +270,7 @@ install_xbps_utils()
local needed _cmd
local xbps_prefix=$XBPS_MASTERDIR/usr/local
for f in bin repo uhelper; do
if [ ! -x $xbps_prefix/sbin/xbps-${f}.static ]; then
needed=yes
fi
done
if [ -n "$needed" ]; then
if [ ! -f ${XBPS_MASTERDIR}/.xbps_utils_done ]; then
echo "=> Installing static XBPS utils into masterdir."
for f in bin repo uhelper; do
_cmd=$(which xbps-${f}.static 2>/dev/null)
@ -286,9 +280,29 @@ install_xbps_utils()
fi
cp -f ${_cmd} $xbps_prefix/sbin
done
touch ${XBPS_MASTERDIR}/.xbps_utils_done
fi
}
install_xbps_src()
{
set -e
install -Dm755 ${XBPS_SBINDIR}/xbps-src \
${XBPS_MASTERDIR}/usr/local/sbin/xbps-src
install -Dm755 ${XBPS_LIBEXECDIR}/doinst-helper.sh \
${XBPS_MASTERDIR}/usr/local/libexec/xbps-src/doinst-helper.sh
install -d ${XBPS_MASTERDIR}/usr/local/share/xbps-src/shutils
install -m644 ${XBPS_SHAREDIR}/shutils/*.sh \
${XBPS_MASTERDIR}/usr/local/share/xbps-src/shutils
install -d ${XBPS_MASTERDIR}/usr/local/share/xbps-src/common
install -m644 ${XBPS_SHAREDIR}/common/* \
${XBPS_MASTERDIR}/usr/local/share/xbps-src/common
install -d ${XBPS_MASTERDIR}/usr/local/share/xbps-src/helpers
install -m644 ${XBPS_SHAREDIR}/helpers/*.sh \
${XBPS_MASTERDIR}/usr/local/share/xbps-src/helpers
set +e
}
xbps_chroot_handler()
{
local action="$1" pkg="$2" rv=0 arg
@ -307,6 +321,7 @@ xbps_chroot_handler()
create_binsh_symlink
create_busybox_links
install_xbps_utils
install_xbps_src
_mount || return $?
@ -314,13 +329,6 @@ xbps_chroot_handler()
prepare_binpkg_repos
fi
# Reinstall xbps-src in the chroot
msg_normal "Installing xbps-src in the masterdir...\n"
env IN_CHROOT=yes LANG=C \
${CHROOT_CMD} $XBPS_MASTERDIR sh -c \
"cd /xbps/xbps-src && make IN_CHROOT=1 install clean" \
2>&1 >/dev/null || return $?
# Update ld.so(8) cache
msg_normal "Updating ld.so(8) cache...\n"
${CHROOT_CMD} $XBPS_MASTERDIR sh -c "ldconfig" || return $?

View file

@ -135,8 +135,8 @@ install_pkg()
BOOTSTRAP_PKG_REBUILD=$BOOTSTRAP_PKG_REBUILD \
CONFIG_FILE=${XBPS_CONFIG_FILE} \
${FAKEROOT_CMD} ${FAKEROOT_CMD_ARGS} \
${XBPS_LIBEXECDIR}/doinst-helper.sh ${curpkgn} \
|| return $?
${XBPS_LIBEXECDIR}/doinst-helper.sh \
${curpkgn} || return $?
# Strip binaries/libraries.
strip_files

View file

@ -28,9 +28,11 @@ readonly XBPS_SRC_BUILD_VERSION=20111118
if [ -n "$IN_CHROOT" ]; then
export XBPS_ETCDIR=/usr/local/etc/xbps
export XBPS_SHAREDIR=/usr/local/share/xbps-src
export XBPS_LIBEXECDIR=/usr/local/libexec
export XBPS_LIBEXECDIR=/usr/local/libexec/xbps-src
else
export XBPS_PREFIX=@@XBPS_INSTALL_PREFIX@@
export XBPS_ETCDIR=@@XBPS_INSTALL_ETCDIR@@
export XBPS_SBINDIR=@@XBPS_INSTALL_SBINDIR@@
export XBPS_SHAREDIR=@@XBPS_INSTALL_SHAREDIR@@
export XBPS_LIBEXECDIR=@@XBPS_INSTALL_LIBEXECDIR@@
fi