--- /dev/null
+#!/bin/sh
+#
+# Script to be run from crontab on buildlogs host.
+# Moves buildlogs around.
+#
+# Expected directory structure:
+#
+# root/$(dist)/$(arch)/
+# .new/
+# OK/
+# FAIL/
+# prevOK/
+#
+# Note that we look for root/*/*/.new/*.info, so don't place any additional
+# directories there.
+
+root="/home/services/ftpd/buildlogs"
+
+handle_info () {
+ info="$1"
+ info_val="$(cat "$info" 2>/dev/null)"
+ if echo "$info_val" | grep -q '^END$' ; then
+ rm "$info" 2>/dev/null || return
+ status=$(echo "$info_val" | grep '^Status:' | sed -e 's/.*: *//')
+ case $status in
+ OK ) s=OK ;;
+ FAIL* ) s=FAIL ;;
+ * )
+ # this script is run from cron, so this should go through mail
+ # to admin
+ echo "bad buildlog status: $status in $info:" 1>&2
+ echo "#v+" 1>&2
+ echo "$info_val" 1>&2
+ echo "#v-" 1>&2
+ return
+ ;;
+ esac
+ archdir="$(dirname "$(dirname "$info")")"
+ file=$(basename "$info" .info)
+ if test -f "$archdir/OK/$file" ; then
+ mv -f "$archdir/OK/$file" "$archdir/prevOK/$file"
+ fi
+ rm -f "$archdir/"{OK,FAIL}"/$file"
+ mv -f "$archdir/.new/$file" "$archdir/$s/$file"
+ fi
+}
+
+for info in $root/*/*/.new/*.info ; do
+ if test -f "$info" ; then
+ handle_info "$info"
+ fi
+done
--- /dev/null
+#!/bin/sh
+# create directories needed for buildlogs
+
+if [ "$1" = "" ] ; then
+ echo "usage: $0 dir"
+ exit 1
+fi
+
+mk ()
+{
+ for d in "$@" ; do
+ mkdir -p $d/{.new,OK,prevOK,FAIL}
+ done
+}
+
+cd "$1" || exit 1
+
+mk ac/{i{3,5,6}86,athlon,sparc,ppc,alpha,SRPMS}
+mk ra/{i{3,5,6}86,sparc,ppc,alpha,SRPMS}
+mk nest/{i{3,5,6}86,ppc,athlon,SRPMS}