]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Update util/check-categories.sh for logging-categories.rst and call from CI
authorMark Andrews <marka@isc.org>
Fri, 8 May 2020 04:29:14 +0000 (14:29 +1000)
committerMark Andrews <marka@isc.org>
Sun, 10 May 2020 23:17:45 +0000 (09:17 +1000)
.gitlab-ci.yml
util/check-categories.sh

index 4a58f62588a138a0a8a7ff2c157b57a50df65737..e1627c0dd46d47af6716f4410ba21aa04d00bbf3 100644 (file)
@@ -396,6 +396,7 @@ misc:
     - xmllint --noout --nonet `git ls-files '*.xml' '*.docbook'`
     - xmllint --noout --nonet --html `git ls-files '*.html'`
     - sh util/check-win32util-configure
+    - sh util/check-categories.sh
   needs: []
   artifacts:
     paths:
index dff066796d5d263d8b050df2ca775b442ec7e79e..4e582f5d9bd175843601c1ccac9b75c01d6d0206 100644 (file)
@@ -7,12 +7,21 @@
 # See the COPYRIGHT file distributed with this work for additional
 # information regarding copyright ownership.
 
-list1=`grep LOGCATEGORY lib/*/include/*/*.h bin/named/include/named/*.h |
-grep "#define.*(&" |
-sed -e 's/.*LOGCATEGORY_\([A-Z_]*\).*/\1/' -e 's/^RRL$/rate-limit/' |
-tr '[A-Z]' '[a-z]' |
-tr _ - | sed 's/^tat$/trust-anchor-telemetry/' | sort -u`
-list2=`sed -n 's;.*<para><command>\(.*\)</command></para>;\1;p' doc/arm/logging-categories.xml | tr '[A-Z]' '[a-z]' | sort -u`
+list1=$(
+       grep LOGCATEGORY lib/*/include/*/*.h bin/named/include/named/*.h |
+       grep "#define.*(&" |
+       sed -e 's/.*LOGCATEGORY_\([A-Z_]*\).*/\1/' -e 's/^RRL$/rate-limit/' |
+       tr '[A-Z]' '[a-z]' |
+       tr _ - |
+       sed 's/^tat$/trust-anchor-telemetry/' |
+       sort -u
+)
+list2=$(
+       awk '$1 == "|" && $3 == "|" && $NF == "|" && $2 ~ /^``.*``$/ { print $2 }' doc/arm/logging-categories.rst |
+       sed 's/``//g' |
+       sort -u
+)
+status=0
 for i in $list1
 do
        ok=no
@@ -26,6 +35,7 @@ do
        if test $ok = no
        then
                echo "$i missing from documentation."
+               status=1
        fi
 done
 for i in $list2
@@ -41,5 +51,7 @@ do
        if test $ok = no
        then
                echo "$i not in code."
+               status=1
        fi
 done
+exit $status