From 4cf07b63e58c8d4ec7f950b5720e52f47721eef0 Mon Sep 17 00:00:00 2001 From: Silvan Calarco Date: Sat, 9 Nov 2013 14:19:34 +0100 Subject: [PATCH] autodist: fix for rebuild and other small fixes --- autodist | 20 +++++++++++--------- autodist-cgi | 10 +++++++--- 2 files changed, 18 insertions(+), 12 deletions(-) diff --git a/autodist b/autodist index 9453ff2..169551a 100755 --- a/autodist +++ b/autodist @@ -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 diff --git a/autodist-cgi b/autodist-cgi index 98da897..901b1f5 100755 --- a/autodist-cgi +++ b/autodist-cgi @@ -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 "

$SHOWLOG log in " + echo -n "

$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 "" echo -n "" - 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 "

Generated by autodist CGI interface. Last update: `date`" + echo "

Generated by autodist CGI interface. Last update: `date`" if [ "$FORMAT" = "xml" ]; then echo -n "]]>" [ "$RELOADTIME" ] && echo -n "$RELOADTIME"