summaryrefslogtreecommitdiffstats
path: root/tools/diag
diff options
context:
space:
mode:
authorphantom <phantom@FreeBSD.org>2002-02-06 17:47:18 +0000
committerphantom <phantom@FreeBSD.org>2002-02-06 17:47:18 +0000
commit90379737f92af4fe48d9db507ad96c646e0709d1 (patch)
treeec6274c204597a44148e84562ea9cc0d49e9bf01 /tools/diag
parenta17a2c3284e17e1540488e24af748770bbc18baf (diff)
downloadFreeBSD-src-90379737f92af4fe48d9db507ad96c646e0709d1.zip
FreeBSD-src-90379737f92af4fe48d9db507ad96c646e0709d1.tar.gz
Add script that checks contents of .ent files (sorting and addresses)
Diffstat (limited to 'tools/diag')
-rw-r--r--tools/diag/ac/ent.sh58
1 files changed, 58 insertions, 0 deletions
diff --git a/tools/diag/ac/ent.sh b/tools/diag/ac/ent.sh
new file mode 100644
index 0000000..19cd9e8
--- /dev/null
+++ b/tools/diag/ac/ent.sh
@@ -0,0 +1,58 @@
+#!/bin/sh -x
+# Copyright (c) 2002 Alexey Zelkin <phantom@FreeBSD.org>
+#
+# ent.sh -- this scripts checks for correcness {authors,teams}.ent files
+#
+# $FreeBSD$
+
+: ${CVSROOT=/home/ncvs}
+prefix=doc/en_US.ISO8859-1/share/sgml
+cvs='cvs -Q co -p'
+diff='diff -u'
+tmp=${TMPDIR-/tmp}/_entities
+
+ckfile() {
+
+ckf=$1
+
+$cvs $prefix/$ckf 2>/dev/null |
+ grep ENTITY |
+ awk '{ print $2 }' > $tmp.entsrc
+sort -u $tmp.entsrc > $tmp.entsrc2
+$diff $tmp.entsrc $tmp.entsrc2 > $ckf.order
+
+$cvs $prefix/$ckf 2>/dev/null |
+ perl -ne 'print "$1 -- $2\n" if /ENTITY ([^ ]+).*<email>(.*)<\/email>/' |
+ grep -vi freebsd.org > $ckf.addr
+
+}
+
+ckresults() {
+
+ckf=$1
+
+if [ -s $ckf.order ]; then
+ echo "Ordering check for $ckf failed. See $ckf.ordering file for details."
+else
+ rm -f $ckf.order
+ echo "Ordering check for $ckf is Ok. "
+fi
+
+if [ -s $ckf.addr ]; then
+ echo "Email addresses for $ckf failed. See $ckf.addr file for details."
+else
+ rm -f $ckf.addr
+ echo "Email addresses check for $ckf is Ok. "
+fi
+
+}
+
+ckfile "authors.ent"
+ckfile "teams.ent"
+
+echo
+
+ckresults "authors.ent"
+ckresults "teams.ent"
+
+rm -f $tmp.entsrc $tmp.entsrc2
OpenPOWER on IntegriCloud