tools/xepchanges.sh
author Matthew Wild <mwild1@gmail.com>
Wed, 24 Apr 2024 11:45:37 +0100
changeset 13487 7b070909bd15
parent 13387 091667bd2f0e
permissions -rwxr-xr-x
prosodyctl shell: Fix invocation with 3+ command arguments The code correctly inserted the ',' when there was already a "%q" in the format string, but then the next argument would fail to match because it inserted ", %q" instead of "%q". The code now matches both, ensuring the generated code will not produce a syntax error with multiple arguments.

#!/bin/sh -eu

wget -N https://xmpp.org/extensions/xeplist.xml
xml2 <xeplist.xml |
	2csv xep-infos/xep number version |
	grep -v ^xxxx,|
	sort -g > xepinfos.csv

xml2 < doc/doap.xml |
	2csv -d '	' xmpp:SupportedXep @rdf:resource xmpp:version |
	sed -r 's/https?:\/\/xmpp\.org\/extensions\/xep-0*([1-9][0-9]*)\.html/\1/' |
	while read -r xep ver ; do
		grep "^$xep," xepinfos.csv | awk -F, "\$2 != \"$ver\" { print (\"XEP-\"\$1\" updated to \"\$2\" from $ver\") }"
	done