diff --git a/webbuild/webbuild-cgi b/webbuild/webbuild-cgi
index 7be0950..553e03d 100755
--- a/webbuild/webbuild-cgi
+++ b/webbuild/webbuild-cgi
@@ -196,6 +196,7 @@ if [ "$USER" -a "$USER_ENABLED" ]; then
USER_ADMIN=
USER_CANMAINTAIN=
USER_CANINSTALL=
+ USER_ENVIRONMENTS=
USER_ALLENVIRONMENTS=
USER_ALLREPOSITORIES=
[ -e $WEBBUILD_STATEDIR/users/$USER.conf ] && . $WEBBUILD_STATEDIR/users/$USER.conf
@@ -356,7 +357,6 @@ fi
# refresh processes list
if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
echo -n "Pending admin requests:"
while read line; do
@@ -384,8 +384,8 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
PROCESSLOG=$5
# if [ -e /proc/$1 -o $5 -lt 256 ]; then
numprocess=$(($numprocess + 1))
- cmdline=`echo $line | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"`
- cmdline=`echo $cmdline | sed "s| --colors web||"`
+ cmdline=`echo "$line" | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"`
+ cmdline=`echo "$cmdline" | sed "s| --colors web||"`
PACKAGE_ENCODED=`cgi_encodevar $4`
[ $numprocess -eq 1 ] && {
# echo -n ""
@@ -402,7 +402,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then
echo -n "
"
elif [ ! -e $PROCESSLOG ]; then
- sed -i "/$1 $USER.* $PROCESSLOG /d" $WEBBUILD_STATEDIR/processes
+ sed -i "\,$1 $USER.* $PROCESSLOG ,d" $WEBBUILD_STATEDIR/processes
continue
else
if [ $RETCODE -eq 256 ]; then
@@ -425,7 +425,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
else
echo -n "\"
"
- echo -n "$cmdline\" (`date -r $5 +\"%F %T\"`)"
+ echo -n "
$cmdline\" (`date -r $5 +'%F %T'`)"
fi
if [ "$2" = "$USER" -o "$USER_ADMIN" ]; then
if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then
@@ -441,6 +441,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
fi
echo -n "
"
done
+
# [ $numprocess -gt 0 ] && echo -n "
"
echo -n "]]>"
exit
@@ -697,7 +698,17 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
# [ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue
SELECTED=
[ "$ENVIRONMENT" = "$i" ] && SELECTED="selected=\"selected\"" || SELECTED=
- if [ "${AUTOPORT_CHROOT_USER[$i]}" = "$USER" -o "${AUTOPORT_CHROOT_USER[$i]}" = "contrib" -o "$USER_ALLENVIRONMENTS" ]; then
+
+ if [ "$USER_ENVIRONMENTS" ]; then
+ for u in $USER_ENVIRONMENTS; do
+ if [ "$i" = "$u" ]; then
+ echo -n ""
+ break
+ fi
+ done
+ elif [ "${AUTOPORT_CHROOT_USER[$i]}" = "$USER" -o "${AUTOPORT_CHROOT_USER[$i]}" = "contrib" -o "$USER_ALLENVIRONMENTS" ]; then
echo -n ""
@@ -771,7 +782,7 @@ if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$MAINTAINERMODE" = "true" ]; then
repname=`basename $f`
[ "$repname" = "$REPOSITORY" ] && SELECTED="selected=selected" || SELECTED=
if [ "$MAINTAINERMODE" = "true" -a ! "$USER_ALLREPOSITORIES" ]; then
- for u in $USER_CANMAINTAIN_REPOSITORIES devel-$USER; do
+ for u in $USER_CANMAINTAIN_REPOSITORIES; do
[ "$u" = "$repname" ] && echo -n ""
done
else
@@ -1222,25 +1233,19 @@ if [ "$MAINTAINERMODE" != "true" ]; then
else
SEND_REPS="devel-contrib"
fi
- for u in $SEND_REPS devel-$USER; do
- [ "$u" = "$repname" ] && echo -n ""
- done
for repname in $SEND_REPS; do
-# repname=`basename $f`
# skip different milestone repositories
- [ "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]/$repname}" = "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]}" ] && continue
-# if [ "$repname" = "devel-${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" -o \
-# "$repname" = "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" -o \
-# "$repname" = "devel-$USER" -o \
-# "$USER_ALLREPOSITORIES" ]; then
+ [ "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]/$repname}" = "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]}" -a \
+ $repname != "devel-$USER" ] && continue
SELECTED=
if [ "$SENDREPOSITORY" = "$repname" ]; then
SELECTED="selected=\"selected\"";
- elif [ ! "$SENDREPOSITORY" -a "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" = "$repname" ]; then
+ elif [ ! "$SENDREPOSITORY" -a "$REPOSITORY" = "$repname" ]; then
+ SELECTED="selected=\"selected\"";
+ elif [ ! "$SENDREPOSITORY" -a "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" = "$repname" -a ! "$SELECTED" ]; then
SELECTED="selected=\"selected\"";
fi
echo -n ""
-# fi
done
echo -n "
"
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "
Autodist batch builds:
"
@@ -2225,14 +2230,16 @@ if [ "$MAINTAINERMODE" = "true" ]; then
[ "$REPOSITORY" ] && echo -n "$REPOSITORY " || echo -n "no repository "
echo -n "(Maintainer mode)"
else
- [ "$PACKAGE" ] && {
+ if [ "$PACKAGE" ]; then
echo -n "$PACKAGE "
[ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:"
echo -n "$SPECVAR_Version-$SPECVAR_Release " || echo -n "no package "
- echo -n "("
- print_environment_descr $ENVIRONMENT
- echo -n ")"
- }
+ else
+ echo -n "no package "
+ fi
+ echo -n "("
+ print_environment_descr $ENVIRONMENT
+ echo -n ")"
fi
echo -n " :: openmamba webbuild"
diff --git a/webbuild/webbuild-functions-private b/webbuild/webbuild-functions-private
index 6025b23..95f201c 100644
--- a/webbuild/webbuild-functions-private
+++ b/webbuild/webbuild-functions-private
@@ -102,7 +102,7 @@ function showEnvironmentPanel() {
# toolchain
echo -n "
"
- local toolchain_output=`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "LANGUAGE=C gcc --version | head -n1; LANGUAGE=C ld -v"`
+ local toolchain_output=`LANGUAGE=C $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" "" "gcc --version | head -n1; LANGUAGE=C ld -v"`
local gcc_ver=`echo $toolchain_output | sed "s|.*(GCC) \([0-9.]*\) .*|\1|"`
local binutils_ver=`echo $toolchain_output | sed "s|.*GNU \(.*\) (GNU Binutils.*)\(.*\)|\1 \2|"`
echo "Toolchain: gcc $gcc_ver, $binutils_ver"
diff --git a/webbuild/webbuild-sudo b/webbuild/webbuild-sudo
index a296237..4ab167a 100755
--- a/webbuild/webbuild-sudo
+++ b/webbuild/webbuild-sudo
@@ -126,15 +126,15 @@ cmdtmpfile=`mktemp --tmpdir=$WEBBUILD_STATEDIR/tmp --suffix=.webbuildcmd`
[ "$PACKAGE" ] || PACKAGE=nopackage
if [ "$MODE" = "background" ]; then
if [ "$WORKINGHOME" ]; then
- [ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;$SUCMDPREFIX \"$COMMAND\""
+ [ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;stdbuf -oL -eL $SUCMDPREFIX \"$COMMAND\""
# WARNING: don't add pipes after $COMMAND or command pid will be wrong
- $SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;stdbuf -o L $COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 > $cmdtmpfile &
+ $SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;stdbuf -oL -eL $COMMAND 2>&1;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 > $cmdtmpfile &
# | tr -d '\f'
#sed "s|<|\<|g" |
else
- [ "$DEBUG" ] && echo "=> $SUCMDPREFIX \"$COMMAND\""
+ [ "$DEBUG" ] && echo "=> $SUCMDPREFIX \"stdbuf -oL -eL $COMMAND\""
# WARNING: don't add pipes after $COMMAND or command pid will be wrong
- $SUCMDPREFIX "$COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 > $cmdtmpfile &
+ $SUCMDPREFIX "stdbuf -oL -eL $COMMAND;echo \"# WEBBUILD_EXITCODE=\$?\"" 2>&1 > $cmdtmpfile &
# | sed "s|<|\<|g" | tr -d '\f'
fi
echo "$! $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes
@@ -146,7 +146,7 @@ else
echo "$$ $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes
rettmpfile=`$SUCMDPREFIX "mktemp --suffix=.webbuildret"`
if [ "$WORKINGHOME" ]; then
- [ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;$SUCMDPREFIX \"$COMMAND\""
+ [ "$DEBUG" ] && echo "=> . /etc/profile;cd $WORKINGHOME/RPM/SPECS;\"$COMMAND\""
if [ "$MODE" = "binary" ]; then
$SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \$? > $rettmpfile" 2>&1
else