webbuild-function, autodist-cgi: also fix buildlogdir for autodist user in chroot mode

This commit is contained in:
Silvan Calarco 2013-01-21 02:37:04 +01:00
parent 0a7f28e6e3
commit 8235cba011
2 changed files with 7 additions and 2 deletions

View File

@ -153,7 +153,7 @@ _EOF
# Security check
[ "${SHOWLOG/\/\.}" != "${SHOWLOG}" ] && continue
if [ "${AUTOPORT_CHROOT[$i]}" ]; then
BUILDLOGDIR="/var/autoport/${AUTOPORT_CHROOT[$i]}/home/${AUTOPORT_CHROOT_USER[$i]}/.autodist/log/"
BUILDLOGDIR="$LOGDIR"
elif [ "${AUTOPORT_NATIVE[$i]}" -o "${AUTOPORT_UPDATE[$i]}" ]; then
BUILDLOGDIR="/var/autodist/log/"
fi

View File

@ -279,7 +279,12 @@ function environment_autoport_logdir() {
function environment_logdir() {
local env=$1
if [ "${AUTOPORT_CHROOT[$env]}" ]; then
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/"
# FIXME: be able to detect real home without using chroot
if [ "${AUTOPORT_CHROOT_USER[$env]}" = "autodist" ]; then
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/var/autodist/log/"
else
echo "/var/autoport/${AUTOPORT_CHROOT[$env]}/home/${AUTOPORT_CHROOT_USER[$env]}/.autodist/log/"
fi
elif [ "${AUTOPORT_NATIVE[$env]}" ]; then
local envhome=`eval echo ~${AUTOPORT_CHROOT_USER[$env]}`
if [ "${AUTOPORT_CHROOT_USER[$env]}" = "autodist" ]; then