xbps-src: repair and improve the bootstrap target (from scratch).

- There's no need to install rdeps into the masterdir, just base-files.
- There's no need to exit if XBPS_TARGET_PKG == sourcepkg, just return.
- After building base-chroot, install bootstrap binary packages.
This commit is contained in:
Juan RP 2014-08-26 10:33:15 +02:00
parent b019b5df6f
commit e582f328b3
3 changed files with 17 additions and 11 deletions

View File

@ -479,16 +479,18 @@ _remove_pkg_cross_deps() {
remove_pkg_autodeps() {
local rval= tmplogf=
[ -z "$CHROOT_READY" ] && return 0
cd $XBPS_MASTERDIR || return 1
msg_normal "${pkgver:-xbps-src}: removing autodeps, please wait...\n"
tmplogf=$(mktemp)
if [ -z "$CHROOT_READY" ]; then
$FAKEROOT_CMD xbps-reconfigure -r $XBPS_MASTERDIR -a >> $tmplogf 2>&1
$FAKEROOT_CMD xbps-remove -r $XBPS_MASTERDIR -Ryo >> $tmplogf 2>&1
else
_remove_pkg_cross_deps
$FAKEROOT_CMD xbps-reconfigure -a >> $tmplogf 2>&1
$FAKEROOT_CMD xbps-remove -Ryo >> $tmplogf 2>&1
fi
if [ $? -ne 0 ]; then
msg_red "${pkgver:-xbps-src}: failed to remove autodeps:\n"

View File

@ -91,9 +91,10 @@ install_pkg() {
remove_pkg $cross
fi
# If base-chroot not installed, install binpkg into masterdir
# from local repository.
if [ -z "$CHROOT_READY" ]; then
# If base-chroot not installed, install "base-files" into masterdir
# from local repository; this is the only pkg required to be able to build
# the bootstrap pkgs from scratch.
if [ -z "$CHROOT_READY" -a "$pkgname" = "base-files" ]; then
msg_normal "Installing $opkg into masterdir...\n"
local _log=$(mktemp --tmpdir|| exit 1)
if [ -n "$XBPS_BUILD_FORCEMODE" ]; then
@ -113,7 +114,7 @@ install_pkg() {
# Package built successfully. Exit directly due to nested install_pkg
# and install_pkg_deps functions.
remove_cross_pkg $cross
exit 0
return 0
fi
}

View File

@ -248,6 +248,7 @@ install_bbotstrap() {
fi
fi
mkdir -p $XBPS_MASTERDIR/var/db/xbps/keys
cd $XBPS_MASTERDIR
cp -f $XBPS_COMMONDIR/repo-keys/*.plist $XBPS_MASTERDIR/var/db/xbps/keys
${_bootstrap_arch} xbps-install -S --repository=${XBPS_REPOSITORY} \
${XBPS_INSTALL_ARGS} -c ${XBPS_HOSTDIR}/repocache \
@ -558,7 +559,9 @@ case "$XBPS_TARGET" in
fi
setup_pkg $XBPS_TARGET_PKG
install_pkg $XBPS_TARGET
rm -f ${bootstrap_vpkg}
[ -d $XBPS_MASTERDIR ] && rm -rf $XBPS_MASTERDIR
unset XBPS_TARGET_PKG
install_bbotstrap
;;
bootstrap-update)
if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then