generatepot-rst.sh: Drop UUID filtering

tools/generatepot-rst.sh has an awk filter to drop UUID from POT files,
but it is unnecessary now. It was introduced to strip UUID information
which was added by default in Sphinx <1.3 [1] in openstack-manuals.
Sphinx >=1.3 does not output UUID information by default [2],
 so is is no longer needed.

In addition, (g)awk 5.0 or later (adopted in Ubuntu 20.04 or later)
complains the current awk regexp. I think it is the time to drop it
rather than fixing the regexp.

[1] 993647f316
[2] https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-gettext_uuid

Related-Bug: #2035226
Change-Id: I57ce0c7d662a4cfd84d9647645a0c6ed9c56ac91
This commit is contained in:
Akihiro Motoki 2023-09-18 17:11:17 +09:00
parent c97e0c0ae4
commit 1ece06158a

View File

@ -446,9 +446,8 @@ function extract_messages_doc {
local fn=$(basename $f .pot)
# If a pot file corresponds to a directory, we use the pot file as-is.
if [ -d doc/source/$fn ]; then
# Remove UUIDs, those are not necessary and change too often
msgcat --use-first --sort-by-file $f | \
awk '$0 !~ /^\# [a-z0-9]+$/' > doc/source/locale/doc-$fn.pot
msgcat --use-first --sort-by-file $f \
> doc/source/locale/doc-$fn.pot
rm $f
else
has_other=1
@ -459,9 +458,8 @@ function extract_messages_doc {
# "git add ${DIRECTORY}/source/locale" will only add a
# single pot file for all top-level files.
if [ "$has_other" = "1" ]; then
# Remove UUIDs, those are not necessary and change too often
msgcat --use-first --sort-by-file doc/build/gettext/*.pot | \
awk '$0 !~ /^\# [a-z0-9]+$/' > doc/source/locale/doc.pot
msgcat --use-first --sort-by-file doc/build/gettext/*.pot \
> doc/source/locale/doc.pot
fi
rm -rf doc/build/gettext/