cpt

Carbs Packaging Tools
git clone git://git.carbslinux.org/cpt
Log | Files | Refs | README | LICENSE

commit c3a33e62c85c5fc774fd1565606b01b0e881a48b
parent 9789b45641ea30e3b20b1152ad7371950b6d5890
Author: Cem Keylan <cem@ckyln.com>
Date:   Mon, 21 Dec 2020 12:58:46 +0300

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.

Diffstat:
Mcontrib/cpt-chbuild | 15++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)

diff --git 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