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_ADMIN=
USER_CANMAINTAIN= USER_CANMAINTAIN=
USER_CANINSTALL= USER_CANINSTALL=
USER_ENVIRONMENTS=
USER_ALLENVIRONMENTS= USER_ALLENVIRONMENTS=
USER_ALLREPOSITORIES= USER_ALLREPOSITORIES=
[ -e $WEBBUILD_STATEDIR/users/$USER.conf ] && . $WEBBUILD_STATEDIR/users/$USER.conf [ -e $WEBBUILD_STATEDIR/users/$USER.conf ] && . $WEBBUILD_STATEDIR/users/$USER.conf
@ -356,7 +357,6 @@ fi
# refresh processes list # refresh processes list
if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
echo -n "<processes><![CDATA[" echo -n "<processes><![CDATA["
if [ "$USER_ADMIN" -a -s $WEBBUILD_STATEDIR/requests ]; then if [ "$USER_ADMIN" -a -s $WEBBUILD_STATEDIR/requests ]; then
echo -n "<div align=left class=processes><b>Pending admin requests:</b>" echo -n "<div align=left class=processes><b>Pending admin requests:</b>"
while read line; do while read line; do
@ -384,8 +384,8 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
PROCESSLOG=$5 PROCESSLOG=$5
# if [ -e /proc/$1 -o $5 -lt 256 ]; then # if [ -e /proc/$1 -o $5 -lt 256 ]; then
numprocess=$(($numprocess + 1)) numprocess=$(($numprocess + 1))
cmdline=`echo $line | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"` cmdline=`echo "$line" | sed "s|$1 $2 $3 $4 $5 $RETCODE ||"`
cmdline=`echo $cmdline | sed "s| --colors web||"` cmdline=`echo "$cmdline" | sed "s| --colors web||"`
PACKAGE_ENCODED=`cgi_encodevar $4` PACKAGE_ENCODED=`cgi_encodevar $4`
[ $numprocess -eq 1 ] && { [ $numprocess -eq 1 ] && {
# echo -n "<div align=left class=processes>" # 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 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...\">" 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 elif [ ! -e $PROCESSLOG ]; then
sed -i "/$1 $USER.* $PROCESSLOG /d" $WEBBUILD_STATEDIR/processes sed -i "\,$1 $USER.* $PROCESSLOG ,d" $WEBBUILD_STATEDIR/processes
continue continue
else else
if [ $RETCODE -eq 256 ]; then if [ $RETCODE -eq 256 ]; then
@ -425,7 +425,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
else else
echo -n "\"<a href=# title=\"Click to see output log\" onClick=ajax_getvalues(\"ENVIRONMENT=$3&PACKAGE=$PACKAGE_ENCODED&" 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 "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 fi
if [ "$2" = "$USER" -o "$USER_ADMIN" ]; then if [ "$2" = "$USER" -o "$USER_ADMIN" ]; then
if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then if [ $RETCODE -eq 256 -a -e /proc/$1 ]; then
@ -441,6 +441,7 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
fi fi
echo -n "<br>" echo -n "<br>"
done done
# [ $numprocess -gt 0 ] && echo -n "</div>" # [ $numprocess -gt 0 ] && echo -n "</div>"
echo -n "]]></processes></webbuild>" echo -n "]]></processes></webbuild>"
exit exit
@ -697,7 +698,17 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
# [ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue # [ "${AUTOPORT_DISABLE[$i]}" -a "${AUTOPORT_DISABLE[$i]}" != "0" ] && continue
SELECTED= SELECTED=
[ "$ENVIRONMENT" = "$i" ] && SELECTED="selected=\"selected\"" || 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>" echo -n "<option value=\"$i\" $SELECTED>"
print_environment_descr $i print_environment_descr $i
echo -n "</option>" echo -n "</option>"
@ -771,7 +782,7 @@ if [ ! "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$MAINTAINERMODE" = "true" ]; then
repname=`basename $f` repname=`basename $f`
[ "$repname" = "$REPOSITORY" ] && SELECTED="selected=selected" || SELECTED= [ "$repname" = "$REPOSITORY" ] && SELECTED="selected=selected" || SELECTED=
if [ "$MAINTAINERMODE" = "true" -a ! "$USER_ALLREPOSITORIES" ]; then 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>" [ "$u" = "$repname" ] && echo -n "<option value=\"$repname\" $SELECTED>$repname</option>"
done done
else else
@ -1222,25 +1233,19 @@ if [ "$MAINTAINERMODE" != "true" ]; then
else else
SEND_REPS="devel-contrib" SEND_REPS="devel-contrib"
fi 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 for repname in $SEND_REPS; do
# repname=`basename $f`
# skip different milestone repositories # skip different milestone repositories
[ "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]/$repname}" = "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]}" ] && continue [ "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]/$repname}" = "${AUTOPORT_IMPORT_REPOSITORIES[$ENVIRONMENT]}" -a \
# if [ "$repname" = "devel-${AUTOPORT_CHROOT_USER[$ENVIRONMENT]}" -o \ $repname != "devel-$USER" ] && continue
# "$repname" = "${AUTOPORT_BASE_REPOSITORY[$ENVIRONMENT]}" -o \
# "$repname" = "devel-$USER" -o \
# "$USER_ALLREPOSITORIES" ]; then
SELECTED= SELECTED=
if [ "$SENDREPOSITORY" = "$repname" ]; then if [ "$SENDREPOSITORY" = "$repname" ]; then
SELECTED="selected=\"selected\""; 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\""; SELECTED="selected=\"selected\"";
fi fi
echo -n "<option value=\"$repname\" $SELECTED>$repname</option>" echo -n "<option value=\"$repname\" $SELECTED>$repname</option>"
# fi
done done
echo -n "</select><br>" echo -n "</select><br>"
[ "${AUTOPORT_UPDATE[$ENVIRONMENT]}" -o "$STATE_ADVANCEDCONTROLS" ] && echo -n "<hr><div style=\"background-color:#FFFFDE\"><b>Autodist batch builds:</b><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 " [ "$REPOSITORY" ] && echo -n "$REPOSITORY " || echo -n "no repository "
echo -n "(Maintainer mode)" echo -n "(Maintainer mode)"
else else
[ "$PACKAGE" ] && { if [ "$PACKAGE" ]; then
echo -n "$PACKAGE " echo -n "$PACKAGE "
[ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:" [ "${SPECVAR_Epoch[0]}" ] && echo -n "${SPECVAR_Epoch[0]}:"
echo -n "$SPECVAR_Version-$SPECVAR_Release " || echo -n "no package " echo -n "$SPECVAR_Version-$SPECVAR_Release " || echo -n "no package "
else
echo -n "no package "
fi
echo -n "(" echo -n "("
print_environment_descr $ENVIRONMENT print_environment_descr $ENVIRONMENT
echo -n ")" echo -n ")"
}
fi fi
echo -n " :: openmamba webbuild</title>" echo -n " :: openmamba webbuild</title>"

View File

@ -102,7 +102,7 @@ function showEnvironmentPanel() {
# toolchain # toolchain
echo -n "<br>" 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 gcc_ver=`echo $toolchain_output | sed "s|.*(GCC) \([0-9.]*\) .*|\1|"`
local binutils_ver=`echo $toolchain_output | sed "s|.*GNU \(.*\) (GNU Binutils.*)\(.*\)|\1 \2|"` local binutils_ver=`echo $toolchain_output | sed "s|.*GNU \(.*\) (GNU Binutils.*)\(.*\)|\1 \2|"`
echo "Toolchain: gcc $gcc_ver, $binutils_ver" echo "Toolchain: gcc $gcc_ver, $binutils_ver"

View File

@ -126,15 +126,15 @@ cmdtmpfile=`mktemp --tmpdir=$WEBBUILD_STATEDIR/tmp --suffix=.webbuildcmd`
[ "$PACKAGE" ] || PACKAGE=nopackage [ "$PACKAGE" ] || PACKAGE=nopackage
if [ "$MODE" = "background" ]; then if [ "$MODE" = "background" ]; then
if [ "$WORKINGHOME" ]; 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 # 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' # | tr -d '\f'
#sed "s|<|\&lt;|g" | #sed "s|<|\&lt;|g" |
else 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 # 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' # | sed "s|<|\&lt;|g" | tr -d '\f'
fi fi
echo "$! $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes 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 echo "$$ $USER $ENVIRONMENT $PACKAGE $cmdtmpfile 256 $COMMAND" >> $WEBBUILD_STATEDIR/processes
rettmpfile=`$SUCMDPREFIX "mktemp --suffix=.webbuildret"` rettmpfile=`$SUCMDPREFIX "mktemp --suffix=.webbuildret"`
if [ "$WORKINGHOME" ]; then 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 if [ "$MODE" = "binary" ]; then
$SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \$? > $rettmpfile" 2>&1 $SUCMDPREFIX ". /etc/profile;cd $WORKINGHOME/RPM/SPECS;$COMMAND;echo \$? > $rettmpfile" 2>&1
else else