generatepot.sh: Drop UUID filtering

(g)awk in Ubuntu 20.04 or later (perhaps gawk >=5.0) has more strict
regexp check and the regexp passed to awk in generatepot.sh cannot
pass the regexp check. This means our script does not work on
Ubuntu 20.04 or later.

This regexp was introduced to strip lines with UUID in a POT file
(e.g., "# 55a7796f27cb4468820fa48b90515add"), but the recent versions
of sphinx does not output such information at least with the sphinx
configuration used in OpenStack CI.
As a result this awk expression in generatepot.sh does nothing,
and I think we can drop this awk expression.

Change-Id: Ia61f74d0a73cc012afde6a4e16ac4431687a65a1
This commit is contained in:
Akihiro Motoki 2023-09-11 18:46:30 +09:00
parent 5a846dbd43
commit 1cc69e482c
1 changed files with 3 additions and 6 deletions

View File

@ -45,9 +45,7 @@ for f in doc/build/gettext/*.pot; do
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
@ -58,9 +56,8 @@ done
# "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/