r1563 - trunk/scripts

Joshua Kwan joshk@haydn.debian.org
Sun, 05 Sep 2004 15:31:12 -0600


Author: joshk
Date: 2004-09-05 15:31:07 -0600 (Sun, 05 Sep 2004)
New Revision: 1563

Added:
   trunk/scripts/check-annotations
Log:
add annotation-checking script


Added: trunk/scripts/check-annotations
===================================================================
--- trunk/scripts/check-annotations	2004-09-05 21:27:20 UTC (rev 1562)
+++ trunk/scripts/check-annotations	2004-09-05 21:31:07 UTC (rev 1563)
@@ -0,0 +1,25 @@
+#!/bin/sh
+
+set -e 
+
+for f in *.diff; do
+	echo -n "$f ... "
+	sed -n 's/^# //gp' $f | awk '
+	BEGIN { horigin="0"; hcset="0"; hinclusion="0"; hdescription="0"; hrevdate="0"; herror="0"; }
+	/^origin:/ { horigin="1"; }
+	/^cset:/ { hcset="1"; }
+	/^inclusion:/ { hinclusion="1"; }
+	/^description:/ { hdescription="1"; }
+	/^revision date:/ { hrevdate="1"; }
+	END {
+		if (horigin == "0") { herror="1"; print "missing: origin "; }
+		if (hcset == "0") { herror="1"; print "missing: cset "; }
+		if (hinclusion == "0") { herror="1"; print "missing: inclusion "; }
+		if (hdescription == "0") { herror="1"; print "missing: description "; }
+		if (hrevdate == "0") { herror="1"; print "missing: hrevdate "; }
+		if (herror == "1") { print "Some fields are missing from this diff"; exit 1; }
+		else { print "OK" }
+	}'
+done
+
+# vim:ai:ts=4:noet


Property changes on: trunk/scripts/check-annotations
___________________________________________________________________
Name: svn:executable
   + *