From 05acdbc2ff53d1112761699ad783e7f8266a3c09 Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Mon, 18 Sep 2023 14:17:17 +0900 Subject: [PATCH] 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]. 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] https://opendev.org/openstack/openstack-manuals/commit/993647f316fbe33a513baffb5cc4ad156355da8a [2] https://www.sphinx-doc.org/en/master/usage/configuration.html#confval-gettext_uuid Related-Bug: #2035226 Change-Id: Ie7babf5a815a8e0a602752e862fdb30814b0fbd1 --- tools/generatepot-rst.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/tools/generatepot-rst.sh b/tools/generatepot-rst.sh index efbf5fe47f..f6ca641e22 100755 --- a/tools/generatepot-rst.sh +++ b/tools/generatepot-rst.sh @@ -66,8 +66,7 @@ if [[ "$REPOSITORY" = "openstack-manuals" && "$DOCNAME" = "common" ]] ; then # In case of common, we use the working directory 'common-work'. # Copies the generated POT to common/source/locale # and finally removes the working directory. - msgcat ${DIRECTORY}/source/locale/common.pot | \ - awk '$0 !~ /^\# [a-z0-9]+$/' \ + msgcat ${DIRECTORY}/source/locale/common.pot \ > ${TOPDIR}common/source/locale/common.pot rm -rf $DIRECTORY else @@ -77,9 +76,8 @@ else # Take care of deleting all temporary files so that # "git add ${DIRECTORY}/source/locale" will only add the # single pot file. - # Remove UUIDs, those are not necessary and change too often - msgcat --sort-by-file ${DIRECTORY}/source/locale/*.pot | \ - awk '$0 !~ /^\# [a-z0-9]+$/' > ${DIRECTORY}/source/$DOCNAME.pot + msgcat --sort-by-file ${DIRECTORY}/source/locale/*.pot \ + > ${DIRECTORY}/source/$DOCNAME.pot rm ${DIRECTORY}/source/locale/*.pot rm -rf ${DIRECTORY}/source/locale/.doctrees/ mv ${DIRECTORY}/source/$DOCNAME.pot ${DIRECTORY}/source/locale/$DOCNAME.pot