From 08af0013de1d77cf0ee46245e50007a9fbf79035 Mon Sep 17 00:00:00 2001 From: merakor Date: Mon, 21 Dec 2020 09:58:45 +0000 Subject: cpt-chbuild: use the cache structure of the library cpt-chbuild previously defined its own cache structure instead of reusing the one defined in the library. This change should fix the paths for users defining their own. FossilOrigin-Name: 4fdadaf3e1494c77deb477630f44fa3be5b0268d2dd9726254ecf228e629a8d0 --- contrib/cpt-chbuild | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) (limited to 'contrib') diff --git a/contrib/cpt-chbuild b/contrib/cpt-chbuild index 923a7fa..6177e67 100755 --- a/contrib/cpt-chbuild +++ b/contrib/cpt-chbuild @@ -18,7 +18,6 @@ die() { case "$(uname -m)" in i*86) arch=i686; esac url="https://dl.carbslinux.org/releases/${arch:-$(uname -m)}/carbs-rootfs.tar.xz" -pid=$$ cd "$cac_dir" @@ -44,20 +43,22 @@ sh256 carbs-rootfs.tar.xz | diff - carbs-rootfs.tar.xz.sum || ( cd carbs-chroot; tar xf ../carbs-rootfs.tar.xz ) } +create_cache empty + log "Creating temporary chroot" -cp -a carbs-chroot "chroot-$pid" +cp -a carbs-chroot "${chr_dir:=$tmp_dir/chroot}" [ "$1" ] && { log "Installing extra packages" - CPT_ROOT=$PWD/chroot-$pid cpt-install "$@" + CPT_ROOT=$chr_dir cpt-install "$@" } -run_hook pre-chroot "" "$PWD/chroot-$pid" +run_hook pre-chroot "" "$chr_dir" log "Entering chroot" if [ "$(id -u)" -eq 0 ]; then - cpt-chroot "chroot-$pid" - rm -rf "chroot-$pid" + cpt-chroot "$chr_dir" + rm -rf "$chr_dir" else - as_root sh -c "cpt-chroot chroot-$pid; rm -rf chroot-$pid" + as_root sh -c "cpt-chroot $chr_dir; rm -rf $chr_dir" fi -- cgit v1.2.3