From 23448e5079ddaccc49c2af1800d5a28fefc0eb90 Mon Sep 17 00:00:00 2001 From: Dylan Araps Date: Sat, 18 Apr 2020 12:20:13 +0300 Subject: [PATCH] kiss-chbuild: Simplify script --- contrib/kiss-chbuild | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/contrib/kiss-chbuild b/contrib/kiss-chbuild index a4cd07e..1f5aff5 100755 --- a/contrib/kiss-chbuild +++ b/contrib/kiss-chbuild @@ -5,19 +5,12 @@ log() { printf '\033[31;1m->\033[m %s.\n' "$@" } -clean() { - log "Destroying chroot" - - su -c "rm -rf chroot-$pid" || clean -} - -pid=$$ -url=https://github.com/kisslinux/repo/releases/download/1.9.11/ - cd "${cac_dir:=$KISS_ROOT${XDG_CACHE_HOME:-$HOME/.cache}/kiss}" [ -f kiss-chroot.tar.xz ] || { log "Downloading chroot tarball" + + url=https://github.com/kisslinux/repo/releases/download/1.9.11/ wget "$url/kiss-chroot.tar.xz" } @@ -27,9 +20,7 @@ cd "${cac_dir:=$KISS_ROOT${XDG_CACHE_HOME:-$HOME/.cache}/kiss}" } log "Creating temporary chroot" -cp -a kiss-chroot "chroot-$pid" - -trap clean EXIT INT +cp -a kiss-chroot "chroot-$$" log "Entering chroot" -su -c "kiss-chroot chroot-$pid" +su -c "kiss-chroot chroot-$$; rm -rf chroot-$$"