cpt

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

commit 36f0188ad63e2538b38ff59369575d03e5b155ba
parent 0d7225554a217c2d463c4a6f5096eb98a0c41c6a
Author: Cem Keylan <cem@ckyln.com>
Date:   Thu, 10 Sep 2020 12:52:40 +0300

cpt-chbuild: run as_root() only if we aren't root.

Diffstat:
Mcontrib/cpt-chbuild | 7++++++-
1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/contrib/cpt-chbuild b/contrib/cpt-chbuild @@ -55,4 +55,9 @@ cp -a carbs-chroot "chroot-$pid" run_hook pre-chroot "" "$PWD/chroot-$pid" log "Entering chroot" -as_root sh -c "cpt-chroot chroot-$pid; rm -rf chroot-$pid" +if [ "$(id -u)" -eq 0 ]; then + cpt-chroot "chroot-$pid" + rm -rf "chroot-$pid" +else + as_root sh -c "cpt-chroot chroot-$pid; rm -rf chroot-$pid" +fi