Add helper for "never built on $ARCH" logs
authorSteve McIntyre <steve@einval.com>
Sun, 23 Dec 2018 15:57:59 +0000 (15:57 +0000)
committerSteve McIntyre <steve@einval.com>
Sun, 23 Dec 2018 15:57:59 +0000 (15:57 +0000)
bin/note_never_arch [new file with mode: 0755]

diff --git a/bin/note_never_arch b/bin/note_never_arch
new file mode 100755 (executable)
index 0000000..c7d5b5b
--- /dev/null
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+if [ "$ARCH"x = ""x ]; then
+    echo "ARCH not set, aborting"
+    exit 1
+fi
+
+for LOGFILE in $@; do
+    case $LOGFILE in
+       *.log)
+           # OK
+       ;;
+       *)
+           echo "ERROR: non-logfile $LOGFILE specified"
+           echo "ABORT"
+           exit 1
+           ;;
+    esac
+
+    if [ -f $LOGFILE ]; then
+       NOTEFILE=$(echo $LOGFILE | sed 's/\.log$/.note/')
+       echo "Never built on $ARCH anyway" > $NOTEFILE
+    else
+       echo "Can't find logfile $LOGFILE, ignoring"
+    fi
+done
+