aboutsummaryrefslogtreecommitdiff
path: root/contrib
diff options
context:
space:
mode:
authormerakor <cem@ckyln.com>2020-12-21 09:58:45 +0000
committermerakor <cem@ckyln.com>2020-12-21 09:58:45 +0000
commit08af0013de1d77cf0ee46245e50007a9fbf79035 (patch)
treef2275c44c555134d906ac2218b47f1e962621914 /contrib
parent14233491c517f1d6e2456d29b35ae99db76a23ac (diff)
downloadcpt-08af0013de1d77cf0ee46245e50007a9fbf79035.tar.gz
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
Diffstat (limited to 'contrib')
-rwxr-xr-xcontrib/cpt-chbuild15
1 files changed, 8 insertions, 7 deletions
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