[postgis-tickets] [SCM] PostGIS branch master updated. 3.3.0rc2-1219-g20745e10c

git at osgeo.org git at osgeo.org
Wed Jul 12 07:39:34 PDT 2023


This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "PostGIS".

The branch, master has been updated
       via  20745e10c4d31db3677160ac4fd7d3d981ef8db8 (commit)
      from  2c159bc11da0a5e62c4f8a68f07dbf3815e39dbc (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
commit 20745e10c4d31db3677160ac4fd7d3d981ef8db8
Author: Sandro Santilli <strk at kbt.io>
Date:   Wed Jul 12 16:39:22 2023 +0200

    Add script to check localized cheatsheets

diff --git a/utils/check_localized_cheatsheets.sh b/utils/check_localized_cheatsheets.sh
new file mode 100755
index 000000000..2a99aa3f0
--- /dev/null
+++ b/utils/check_localized_cheatsheets.sh
@@ -0,0 +1,36 @@
+#!/bin/sh
+
+test -n "$3" || {
+  echo "Usage: $0 <source_file> <source_lang> [<target_lang>, ...]" >&2
+  exit 1
+};
+
+SOURCE_FILE="$1"
+shift
+SOURCE_LANG="$1"
+shift
+TARGET_LANGS="$@"
+
+test -e "${SOURCE_FILE}" || {
+  echo "No such file or directory: ${SOURCE_FILE}" >&2
+  exit 1
+}
+
+# Read sup tags from source language cheatsheet
+for tag in $(xmllint --html --xpath '/html/body/span/sup/text()' "${SOURCE_FILE}"); do
+  count=$(grep -c "<sup> *$tag *</sup>" "${SOURCE_FILE}")
+  echo "Occurrences of tag $tag in source file: $count"
+  for lang in ${TARGET_LANGS}; do
+    TR_FILE=$(echo "${SOURCE_FILE}" | sed "s/-${SOURCE_LANG}/-${lang}/");
+    test -e "${TR_FILE}" || {
+      echo "No such file or directory: ${TR_FILE}" >&2
+      exit 1
+    }
+    count_lang=$(grep -c "<sup> *$tag *</sup>" "${TR_FILE}")
+    echo "Occurrences of tag $tag in $lang file: $count_lang"
+    if [ $count_lang != $count ]; then
+      echo "Tag tag $tag occurs $count times in ${SOURCE_FILE} and $count_lang times in ${TR_FILE}" >&2
+      exit 1
+    fi
+  done
+done

-----------------------------------------------------------------------

Summary of changes:
 utils/check_localized_cheatsheets.sh | 36 ++++++++++++++++++++++++++++++++++++
 1 file changed, 36 insertions(+)
 create mode 100755 utils/check_localized_cheatsheets.sh


hooks/post-receive
-- 
PostGIS


More information about the postgis-tickets mailing list