webbuild: fixes to matching autodist jobs with package name and other small fixes

This commit is contained in:
Silvan Calarco 2015-08-22 17:58:14 +02:00
parent 5f2e54f58a
commit a191ef0eb3
2 changed files with 11 additions and 9 deletions

View File

@ -397,9 +397,11 @@ if [ "$REQUEST" = "refresh" -o "$REQUEST" = "refreshjobs" ]; then
u="$(uptime)" u="$(uptime)"
f="$(df / -k -h --output=avail,pcent|tail -n1)" f="$(df / -k -h --output=avail,pcent|tail -n1)"
b=`ps ax|grep "rpmbuild .*\.spec$"|while read l; do basename "${l/.spec}"; done` b=`ps ax|grep "rpmbuild .*\.spec$"|while read l; do basename "${l/.spec}"; done`
echo -n "Load: <b>${u/*: }</b> | Disk: <b>$f</b> | Now building: <b>$b</b> | " echo -n "Load: <b>${u/*: }</b> | Disk: <b>$f</b> | "
[ "$b" ] && echo -n "Building now: <b>$b</b> | "
[ "`ps cax|grep smart`" ] && echo "<b>Updating</b> | "
if [ "$STATE_JOBSSHOWALL" != "1" ]; then if [ "$STATE_JOBSSHOWALL" != "1" ]; then
echo "My jobs: [<a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=true\");>Show all jobs</a>]" echo "$USER's jobs: [<a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=true\");>Show all jobs</a>]"
else else
echo "All jobs: [<a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=false\");>Only show my jobs</a>]" echo "All jobs: [<a href=# onclick=ajax_getvalues(\"REQUEST=refreshjobs&JOBSSHOWALL=false\");>Only show my jobs</a>]"
fi fi
@ -1198,7 +1200,7 @@ fi
if [ "$PACKAGE" ]; then if [ "$PACKAGE" ]; then
[ "$AUTODISTJOB" ] || AUTODISTJOB=${PACKAGE/\/*} [ "$AUTODISTJOB" ] || AUTODISTJOB=${PACKAGE/\/*}
AUTODISTJOB="${AUTODISTJOB/-/_}" AUTODISTJOB="${AUTODISTJOB//[-]/_}"
PACKAGE=${PACKAGE/*\/} PACKAGE=${PACKAGE/*\/}
eval `$SUDO_WRAPPER specinfo $ENVIRONMENT "$USER" $PACKAGE ""` eval `$SUDO_WRAPPER specinfo $ENVIRONMENT "$USER" $PACKAGE ""`
[ $? -eq 0 ] && SPECAVAILABLE=1 [ $? -eq 0 ] && SPECAVAILABLE=1
@ -1339,10 +1341,10 @@ if [ "$MAINTAINERMODE" != "true" ]; then
if [ "$AUTODISTJOB" -a "$AUTODISTJOB" = "$f" ]; then if [ "$AUTODISTJOB" -a "$AUTODISTJOB" = "$f" ]; then
SELECTED="selected=\"selected\"" SELECTED="selected=\"selected\""
AUTODISTJOBSELECTED=1 AUTODISTJOBSELECTED=1
elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOB" ]; then elif [ "${PACKAGE}" = "$f" -a ! "$AUTODISTJOB" ]; then
# elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOBSELECTED" -a "$REQUEST" != "autodistjobchange" ]; then # elif [ "$PACKAGE" = "$f" -a ! "$AUTODISTJOBSELECTED" -a "$REQUEST" != "autodistjobchange" ]; then
SELECTED="selected=\"selected\"" SELECTED="selected=\"selected\""
AUTODISTJOB=$f AUTODISTJOB=${f//[-]/_}
AUTODISTJOBSELECTED=1 AUTODISTJOBSELECTED=1
fi fi
JOBENCODED=`cgi_encodevar $f` JOBENCODED=`cgi_encodevar $f`
@ -1354,7 +1356,7 @@ if [ "$MAINTAINERMODE" != "true" ]; then
echo -n "<option value=\"$PACKAGEENCODED\" $SELECTED>$PACKAGE (defaults)</option>" echo -n "<option value=\"$PACKAGEENCODED\" $SELECTED>$PACKAGE (defaults)</option>"
fi fi
echo -n "</select>" echo -n "</select>"
if [ "$AUTODISTJOBSELECTED" -a "$AUTODISTJOB" = "$PACKAGE" ]; then if [ "$AUTODISTJOBSELECTED" -a "$AUTODISTJOB" = "${PACKAGE//[-]/_}" ]; then
echo -n "<br><font color=red>You should use autodist for this package!</font>" echo -n "<br><font color=red>You should use autodist for this package!</font>"
fi fi
if [ "$AUTODISTJOB" ]; then if [ "$AUTODISTJOB" ]; then

View File

@ -254,14 +254,14 @@ function show_docs() {
done done
echo -n "<br>" echo -n "<br>"
for f in $@; do for f in $@; do
echo -n "<a name=logfile-$f><p style=\"background-color:gray\"><b>File $f:</b></a><pre>" echo -n "<a name=logfile-$f></a><p><b>File $f:</b><pre>"
ftype="`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && file $f"`" ftype="`$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && file $f"`"
if [ "${ftype/text}" = "${ftype}" ]; then if [ "${ftype/text}" = "${ftype}" ]; then
echo "<p>Binary file; skipping." echo "<p>Binary file; skipping."
continue continue
fi fi
$SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \ $SUDO_WRAPPER 0 $ENVIRONMENT "$USER" $PACKAGE \
"cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && head -c 10240 $f | sed \"s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output "cd $SPECVAR_RPMBUILDDIR/$SPECVAR_BUILDDIR && head -c 10240 $f | strings | sed \"s|<|\&lt;|g;s|[[:cntrl:]]\[[0-9;]*m||g\"" | parse_generic_output
RET=$? RET=$?
echo -n "</pre>" echo -n "</pre>"
done done