diff --git a/xbps-src/shutils/chroot.sh.in b/xbps-src/shutils/chroot.sh.in index bee5392636..6cd75bece9 100644 --- a/xbps-src/shutils/chroot.sh.in +++ b/xbps-src/shutils/chroot.sh.in @@ -29,6 +29,20 @@ # trap "_umount && return $?" 0 INT QUIT TERM +_mount() +{ + MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ + @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount + return $? +} + +_umount() +{ + MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ + @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount + return $? +} + [ -n "$base_chroot" ] && return 0 if [ "${chroot_cmd}" = "chroot" ]; then @@ -41,7 +55,7 @@ fi . $XBPS_SHUTILSDIR/builddep_funcs.sh check_installed_pkg xbps-base-chroot-0.11 if [ $? -ne 0 ]; then - echo "The '$pkgname' package requires to be installed in a chroot." + echo "${XBPS_MASTERDIR} has not been prepared for chroot operations." echo "Please install 'xbps-base-chroot>=0.11' and try again." exit 1 fi @@ -222,20 +236,6 @@ install_xbps_utils() fi } -_mount() -{ - MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ - @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper mount - return $? -} - -_umount() -{ - MASTERDIR="${XBPS_MASTERDIR}" ${sudo_cmd} \ - @@XBPS_INSTALL_LIBEXECDIR@@/xbps-src-chroot-helper umount - return $? -} - xbps_chroot_handler() { local action="$1" pkg="$2" norm_builddir="$3" rv=0