From 40a6d63364ab8fb613eca73c8acf2ea0f5499eca Mon Sep 17 00:00:00 2001 From: Juan RP Date: Mon, 27 Oct 2008 08:35:40 +0100 Subject: [PATCH] chroot: do not umount unnecessarily in the build target. --HG-- extra : convert_revision : bb005f7c4dae217282a231eea9f71869479b97d2 --- helper-templates/chroot.sh | 6 ++++-- xbps.sh | 7 +++++-- 2 files changed, 9 insertions(+), 4 deletions(-) diff --git a/helper-templates/chroot.sh b/helper-templates/chroot.sh index a434ed5110c..540290701c9 100644 --- a/helper-templates/chroot.sh +++ b/helper-templates/chroot.sh @@ -13,6 +13,10 @@ if [ $? -ne 0 ]; then fi if [ "$(id -u)" -ne 0 ]; then + if [ -z "$base_chroot" ]; then + echo "*** ERROR: this package must be built inside of the chroot ***" + exit 1 + fi echo "*** ERROR: you must be root to use this target ***" exit 1 fi @@ -82,7 +86,6 @@ configure_chroot_pkg() rebuild_ldso_cache env in_chroot=yes chroot $XBPS_MASTERDIR /xbps/xbps.sh configure $pkg echo "==> Exiting from the chroot on $XBPS_MASTERDIR." - umount_chroot_fs } build_chroot_pkg() @@ -94,7 +97,6 @@ build_chroot_pkg() rebuild_ldso_cache env in_chroot=yes chroot $XBPS_MASTERDIR /xbps/xbps.sh build $pkg echo "==> Exiting from the chroot on $XBPS_MASTERDIR." - umount_chroot_fs } install_chroot_pkg() diff --git a/xbps.sh b/xbps.sh index c498a78df64..9d196375ce8 100755 --- a/xbps.sh +++ b/xbps.sh @@ -55,7 +55,6 @@ Targets: extract Extract distribution file(s) into build directory. fetch Download distribution file(s). info Show information about . - install-chroot Installs a package inside a chroot. install-destdir build + configure + install into destdir. install install-destdir + stow. list Lists all currently installed packages. @@ -128,7 +127,7 @@ run_func() [ -z "$func" ] && return 1 - type -t $func | grep -q 'shell function' + type -t $func | grep -q 'function' [ $? -eq 0 ] && $func } @@ -341,6 +340,8 @@ extract_distfiles() local ltar_cmd= local f= + [ -f $XBPS_EXTRACT_DONE ] && return 0 + # # If we are being called via the target, just extract and return. # @@ -1506,6 +1507,7 @@ build) if [ -z "$base_chroot" -a -z "$in_chroot" ]; then run_file $XBPS_TMPLHELPDIR/chroot.sh build_chroot_pkg $2 + umount_chroot_fs else build_src_phase $2 fi @@ -1523,6 +1525,7 @@ configure) if [ -z "$base_chroot" -a -z "$in_chroot" ]; then run_file $XBPS_TMPLHELPDIR/chroot.sh configure_chroot_pkg $2 + umount_chroot_fs else configure_src_phase $2 fi