Revert "xbps-src: simplify chroot_handler usage."

This reverts commit 0e0eb9001a.

Introduces new issues... revert until it's fixed properly.
This commit is contained in:
Juan RP 2015-01-04 12:14:14 +01:00
parent 0e0eb9001a
commit 6100f83bcf
2 changed files with 29 additions and 10 deletions

View File

@ -164,7 +164,7 @@ chroot_handler() {
local action="$1" pkg="$2" rv=0 arg= _envargs= _chargs= local action="$1" pkg="$2" rv=0 arg= _envargs= _chargs=
if [ -n "$IN_CHROOT" -o -z "$CHROOT_READY" ]; then if [ -n "$IN_CHROOT" -o -z "$CHROOT_READY" ]; then
return 1 return 0
fi fi
# Debian uses /run/shm instead... # Debian uses /run/shm instead...
if [ -d /run/shm ]; then if [ -d /run/shm ]; then

View File

@ -534,38 +534,57 @@ case "$XBPS_TARGET" in
install_bbootstrap install_bbootstrap
;; ;;
bootstrap-update) bootstrap-update)
chroot_handler ${XBPS_TARGET} || remove_pkg_autodeps if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
${XBPS_INSTALL_CMD} -yu chroot_handler ${XBPS_TARGET} dummy
else
pkgver=xbps-src
remove_pkg_autodeps
${XBPS_INSTALL_CMD} -yu
fi
;; ;;
chroot) chroot)
chroot_handler chroot dummy chroot_handler chroot dummy
;; ;;
clean) clean)
if [ -z "$XBPS_TARGET_PKG" ]; then if [ -z "$XBPS_TARGET_PKG" ]; then
chroot_handler remove-autodeps || remove_pkg_autodeps if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler remove-autodeps
else
pkgver=xbps-src
remove_pkg_autodeps
fi
msg_normal "xbps-src: cleaning up masterdir...\n" msg_normal "xbps-src: cleaning up masterdir...\n"
rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir rm -rf $XBPS_MASTERDIR/builddir $XBPS_MASTERDIR/destdir
else else
read_pkg read_pkg
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || { if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || exit $?
else
remove_pkg_wrksrc $wrksrc remove_pkg_wrksrc $wrksrc
remove_pkg_statedir remove_pkg_statedir
if declare -f do_clean >/dev/null; then if declare -f do_clean >/dev/null; then
run_func do_clean run_func do_clean
fi fi
remove_pkg $XBPS_CROSS_BUILD fi
} remove_pkg $XBPS_CROSS_BUILD
fi fi
;; ;;
remove-autodeps) remove-autodeps)
chroot_handler $XBPS_TARGET || remove_pkg_autodeps if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler remove-autodeps
else
pkgver=xbps-src
remove_pkg_autodeps
fi
;; ;;
fetch|extract|build|configure|install|pkg) fetch|extract|build|configure|install|pkg)
BEGIN_INSTALL=1 BEGIN_INSTALL=1
read_pkg read_pkg
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG || { if [ -n "$CHROOT_READY" -a -z "$IN_CHROOT" ]; then
chroot_handler $XBPS_TARGET $XBPS_TARGET_PKG
else
install_pkg $XBPS_TARGET $XBPS_CROSS_BUILD install_pkg $XBPS_TARGET $XBPS_CROSS_BUILD
} fi
;; ;;
remove|remove-destdir) remove|remove-destdir)
read_pkg read_pkg