autodist: fix for rebuild and other small fixes

This commit is contained in:
Silvan Calarco 2013-11-09 14:19:34 +01:00
parent 0669999e60
commit 4cf07b63e5
2 changed files with 18 additions and 12 deletions

View File

@ -527,7 +527,7 @@ function launch_pkgs_loop() {
JOB_ARGS="$JOB_ARGS$DEFINES_STRING"
[ "$patch_operation" = "buildinstall" ] && patch_operation=build
[ "$patch_operation" = "autoupdate" ] && patch_operation=update
[ "$patch_operation" = "autoupdate" -o "$patch_operation" = "rebuild" ] && patch_operation=update
# launch loop for each package
for pkg in ${JOB_PKGS[*]}; do
@ -550,7 +550,7 @@ function launch_pkgs_loop() {
rm -f ${LOGDIR}/failed/${LOGFILE_PKG_NAME}-${LOGFILE_SUFFIX}
case $operation in
autoupdate|update|build|buildinstall)
autoupdate|update|build|rebuild|buildinstall)
[ -e $spec_dir/$pkg.spec ] || {
case $SEVERITY in
0) ;;
@ -986,7 +986,7 @@ if [ "$do_autobuild" = "1" ]; then
if [ "${VERSION:0:1}" != "+" ]; then
if [ $REBUILDOLDCOUNT -lt $AUTODIST_REBUILDOLD_MAX -a $BUILDDATE -ge $AUTODIST_REBUILDOLD_FROMDATE ]; then
# rebuilt 20 oldest packages (but newer than 20090101)
# rebuilt oldest packages
REBUILDOLDCOUNT=$(($REBUILDOLDCOUNT + 1))
VERSION=+0
else
@ -1007,12 +1007,14 @@ if [ "$do_autobuild" = "1" ]; then
fi
fi
# check legacylist
awk '{ print $1 }' $LEGACYLIST | grep "^$PKGNAME$" >/dev/null && {
echo "?= Job $PKGNAME is in the legacy list; skipping automatic update"
echo "$PKGNAME $DATE_NOW 100" >> $SKIPPEDLISTDIR/auto.skip
continue
}
if [ "${VERSION:0:1}" != "+" ]; then
# check legacylist
awk '{ print $1 }' $LEGACYLIST | grep "^$PKGNAME$" >/dev/null && {
echo "?= Job $PKGNAME is in the legacy list; skipping automatic update"
echo "$PKGNAME $DATE_NOW 100" >> $SKIPPEDLISTDIR/auto.skip
continue
}
fi
# manually or from lists scheduled jobs
if [ "${VERSION:0:1}" == "+" -a "$VERSION" != "+0" ]; then

View File

@ -102,6 +102,8 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
LOGDIR=`environment_logdir $i`
AUTOPORTLOGDIR=`environment_autoport_logdir $i`
ENVROOTDIR=`environment_rootdir $i`
if [ "${AUTOPORT_UPDATE[$i]}" ]; then
LOGFILE="$LOGDIR/autodist.log"
LASTLOGFILE="$LOGDIR/autodist-last.log"
@ -125,7 +127,7 @@ for i in `seq 0 ${#AUTOPORT_ARCH[*]}`; do
fi
if [ "$SHOWLOG" ]; then
if [ "$HOST" = "$AS_HOST" -a "$NUM" = "$i" ]; then
echo -n "<h2>$SHOWLOG log in "
echo -n "<p><h2>$SHOWLOG log in "
if [ "${AUTOPORT_UPDATE[$i]}" ]; then
echo -n "update"
elif [ "${AUTOPORT_CHROOT[$i]}" ]; then
@ -149,6 +151,8 @@ _EOF
cat $LOGFILE | parse_build_output
elif [ "$SHOWLOG" = "last" ]; then
cat $LASTLOGFILE | parse_build_output
LASTLOGDETAILS=`tail $LASTLOGFILE | grep "See .* for details" | sed "s|.*See \(.*\) for details.*|\1|"`
cat $ENVROOTDIR/$LASTLOGDETAILS | parse_build_output
else
# Security check
[ "${SHOWLOG/\/\.}" != "${SHOWLOG}" ] && continue
@ -184,7 +188,7 @@ _EOF
fi
echo -n "</pre></code>"
echo -n "</div></div>"
break
# break
fi
[ "${AUTOPORT_UPDATE[$i]}" ] && break
elif [ ! "$SHOWLOG" ]; then
@ -363,7 +367,7 @@ if [ "$AS_HOST" = "0" -a ! "$SHOWLOG" ]; then
fi
fi
if [ "$AS_HOST" = "0" ]; then
echo "<p><i>Generated by autodist CGI interface. Last update: `date`</i>"
echo "<br><p><i>Generated by autodist CGI interface. Last update: `date`</i>"
if [ "$FORMAT" = "xml" ]; then
echo -n "]]></output>"
[ "$RELOADTIME" ] && echo -n "<reloadtime>$RELOADTIME</reloadtime>"