]> git.pld-linux.org Git - projects/buildlogs.git/commitdiff
- scripts for buildlogs
authorMichal Moskal <michal@moskal.me>
Thu, 12 Jun 2003 10:23:28 +0000 (10:23 +0000)
committerMichal Moskal <michal@moskal.me>
Thu, 12 Jun 2003 10:23:28 +0000 (10:23 +0000)
helpers/buildlogs-mover.sh [new file with mode: 0644]
helpers/install-buildlogs-tree.sh [new file with mode: 0644]

diff --git a/helpers/buildlogs-mover.sh b/helpers/buildlogs-mover.sh
new file mode 100644 (file)
index 0000000..077d1e4
--- /dev/null
@@ -0,0 +1,52 @@
+#!/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
diff --git a/helpers/install-buildlogs-tree.sh b/helpers/install-buildlogs-tree.sh
new file mode 100644 (file)
index 0000000..3e098e2
--- /dev/null
@@ -0,0 +1,20 @@
+#!/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}
This page took 0.031526 seconds and 4 git commands to generate.