webbuild: sync recent minor fixes

This commit is contained in:
Silvan Calarco 2014-04-25 12:10:30 +02:00
parent bdc9145d01
commit 49f415f364
3 changed files with 36 additions and 29 deletions

View File

@ -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 "<processes><![CDATA["
if [ "$USER_ADMIN" -a -s $WEBBUILD_STATEDIR/requests ]; then
echo -n "<div align=left class=processes><b>Pending admin requests:</b>"
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 "<div align=left class=processes>"
@ -402,7 +402,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then
echo -n "<img style=\"margin-top:-1px;margin-right:2px;\" width=10 height=10 src=\"/images/inprogress.gif\" alt=\"running...\" title=\"running...\">"
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 "\"<a href=# title=\"Click to see output log\" onClick=ajax_getvalues(\"ENVIRONMENT=$3&PACKAGE=$PACKAGE_ENCODED&"
echo -n "REQUEST=showlog&LOGTYPE=processoutput&LOGFILE=$5\")>"
echo -n "<b><i>$cmdline</i></b>\"</a> (`date -r $5 +\"%F %T\"`)"
echo -n "<b><i>$cmdline</i></b>\"</a> (`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 "<br>"
done
# [ $numprocess -gt 0 ] && echo -n "</div>"
echo -n "]]></processes></webbuild>"
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 "<option value=\"$i\" $SELECTED>"
print_environment_descr $i
echo -n "</option>"
break
fi
done
elif [ "${AUTOPORT_CHROOT_USER[$i]}" = "$USER" -o "${AUTOPORT_CHROOT_USER[$i]}" = "contrib" -o "$USER_ALLENVIRONMENTS" ]; then
echo -n "<option value=\"$i\" $SELECTED>"
print_environment_descr $i
echo -n "</option>"
@ -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 "<option value=\"$repname\" $SELECTED>$repname</option>"
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 "<option value=\"$repname\" $SELECTED>$repname</option>"
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 "<option value=\"$repname\" $SELECTED>$repname</option>"
# fi
done
echo -n "</select><br>"
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "<hr><div style=\"background-color:#FFFFDE\"><b>Autodist batch builds:</b><br>"
@ -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</title>"

View File

@ -102,7 +102,7 @@ function showEnvironmentPanel() {
# toolchain
echo -n "<br>"
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"

View File

@ -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|<|\&lt;|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|<|\&lt;|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