aboutsummaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorChristophe Romain <christophe.romain@process-one.net>2019-06-17 12:02:23 +0200
committerChristophe Romain <christophe.romain@process-one.net>2019-06-17 12:02:23 +0200
commit4fe995c272d1897647325465ac0337d00197cbe5 (patch)
tree491853c8bbdbea0921736610d984b41eb6428fea /tools
parentBump supported version of XEP-0355 (diff)
Add helper to check xep implementations and versions
Diffstat (limited to 'tools')
-rwxr-xr-xtools/check_xep_versions.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/tools/check_xep_versions.sh b/tools/check_xep_versions.sh
new file mode 100755
index 000000000..c22781aaa
--- /dev/null
+++ b/tools/check_xep_versions.sh
@@ -0,0 +1,21 @@
+#!/bin/bash
+
+check_xep()
+{
+ xep=xep-$1
+ int=$(echo $1 | sed 's/^0*//')
+ [ -f $BASE/doc/$xep ] || curl -s -o $BASE/doc/$xep https://xmpp.org/extensions/$xep.html
+ title=$(sed '/<title>/!d;s/.*<title>\(.*\)<\/title>.*/\1/' $BASE/doc/$xep)
+ vsn=$(grep -A1 Version $BASE/doc/$xep | sed '/<dd>/!d;q' | sed 's/.*>\(.*\)<.*/\1/')
+ imp=$(grep "{xep, $int," $BASE/src/* | sed "s/.*src\/\(.*\).erl.*'\([0-9.-]*\)'.*/\1 \2/")
+ [ "$imp" == "" ] && imp="NA 0.0"
+ echo "$title;$vsn;${imp/ /;}"
+}
+
+[ $# -eq 1 ] && BASE="$1" || BASE="$PWD"
+[ -d $BASE/doc ] || mkdir $BASE/doc
+
+for x_num in $(grep "{xep" $BASE/src/* | sed "s/,//" | awk '{printf("%04d\n", $2)}' | sort -u)
+do
+ check_xep $x_num
+done