diff --git a/helper-templates/chroot.sh b/helper-templates/chroot.sh index 540290701c..9835910280 100644 --- a/helper-templates/chroot.sh +++ b/helper-templates/chroot.sh @@ -6,6 +6,8 @@ # Umount stuff if SIGINT or SIGQUIT was caught trap umount_chroot_fs INT QUIT +[ -n "$base_chroot" ] && return 0 + check_installed_pkg xbps-base-chroot 0.1 if [ $? -ne 0 ]; then echo "*** ERROR: xbps-base-chroot pkg not installed ***" diff --git a/xbps.sh b/xbps.sh index 774c558521..406c2c2587 100755 --- a/xbps.sh +++ b/xbps.sh @@ -1212,7 +1212,7 @@ install_pkg() # If we are being invoked via install-chroot, reread config file # to get correct stuff. # - if [ "$XBPS_MASTERDIR" = "/" ]; then + if [ -n "$in_chroot" ]; then check_config_vars set_defvars fi @@ -1221,6 +1221,12 @@ install_pkg() run_file $cur_tmpl pkg="$curpkgn-$version" + if [ -z "$base_chroot" -a -z "$in_chroot" ]; then + . $XBPS_TMPLHELPDIR/chroot.sh + install_chroot_pkg $curpkgn + return $? + fi + # # If we are the originator package save the path this template in # other var for future use. @@ -1547,20 +1553,10 @@ info) ;; install-destdir) install_destdir_target=yes - if [ -z "$base_chroot" -a -z "$in_chroot" ]; then - run_file $XBPS_TMPLHELPDIR/chroot.sh - install_chroot_pkg $2 - else - install_pkg $2 - fi + install_pkg $2 ;; install) - if [ -z "$base_chroot" -a -z "$in_chroot" ]; then - run_file $XBPS_TMPLHELPDIR/chroot.sh - install_chroot_pkg $2 - else - install_pkg $2 - fi + install_pkg $2 ;; list) list_pkgs