From 1cc69e482cb0922a2770b477ca9e7e497036c315 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Mon, 11 Sep 2023 18:46:30 +0900 Subject: [PATCH] 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 --- tools/generatepot.sh | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/tools/generatepot.sh b/tools/generatepot.sh index 47ce8a2..302ff35 100755 --- a/tools/generatepot.sh +++ b/tools/generatepot.sh @@ -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/