From 613e05021cb835d92edbeacf9cb3f16f633850d0 Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Mon, 23 Nov 2020 14:11:22 -0700 Subject: [PATCH] install.sh: compute a 'usejail' value and use it Instead of checking disable_jailsetup and chrooted separately to determine whether or not a chroot jail is in use, compute a 'usejail' value and check that instead. If jail setup is NOT disabled AND we are chrooted then we ARE using a chroot jail. Use the new 'usejail' value to make sure the "dbonly" setup always happens if a chroot jail is not in use. Signed-off-by: Kyle J. McKay --- install.sh | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index bd7ccde..b41d8ab 100755 --- a/install.sh +++ b/install.sh @@ -792,7 +792,9 @@ chmod 02775 "$cfg_reporoot/_recyclebin" || echo "WARNING: Cannot chmod $cfg_repo chmod 00755 "$cfg_reporoot/_global" "$cfg_reporoot/_global/hooks" "$cfg_reporoot/_global/empty" || echo "WARNING: Cannot chmod $cfg_reporoot/_global properly" -if [ "${cfg_disable_jailsetup:-0}" = "0" ] && [ -n "$cfg_chrooted" ]; then +usejail= +[ "${cfg_disable_jailsetup:-0}" != "0" ] || [ "${cfg_chrooted:-0}" = "0" ] || usejail=1 +if [ -n "$usejail" ]; then echo "*** Setting up chroot jail for pushing..." if [ -n "$isroot" ]; then # jailsetup may install things from $cfg_basedir/bin into the @@ -816,7 +818,7 @@ fi echo "*** Setting up jail configuration (project database)..." -[ -n "$isroot" ] || ./jailsetup.sh dbonly +[ -n "$usejail" ] && [ -n "$isroot" ] || ./jailsetup.sh dbonly mkdir -p "$cfg_chroot" "$cfg_chroot/etc" touch "$cfg_chroot/etc/passwd" "$cfg_chroot/etc/group" chown "$cfg_mirror_user""$owngroup" "$cfg_chroot/etc" || -- 2.11.4.GIT