From 66888cbd31ef4013e3a958648af233bd81e4f96e Mon Sep 17 00:00:00 2001 From: Akihiro Motoki Date: Mon, 11 Sep 2023 14:04:01 +0900 Subject: [PATCH] Fix doc-pot-filter.sh doc-pot-filter.sh is prepared to drop numbers from *.csv. Howover, the path of CSV files in POT files were changed from some version of Sphinx (from "doc/source/data/*.csv" to "../../source/data/*.csv") and doc-pot-filter.sh does not work expectedly. This commit adjusts the path of CSV files in POT files. The number of entries in the target POT file (atc-stats.pot) is printed before and after the filter is applied. I believe this helps us debug the similar issue in future if needed. Change-Id: I32d760a735ab1ae491d7e5efb36fd5059da0cd11 --- tools/doc-pot-filter.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tools/doc-pot-filter.sh b/tools/doc-pot-filter.sh index 80c2d9d..fa3166a 100755 --- a/tools/doc-pot-filter.sh +++ b/tools/doc-pot-filter.sh @@ -22,10 +22,10 @@ set -xe # This script assumes that the script locates in /tools, # and project documentation sources are in /doc/source directory. -DIRECTORY=doc - # Exclude atc-stats/data/*.csv from POT file +TARGET=doc/build/gettext/atc-stats.pot +msgfmt --statistics -o /dev/null ${TARGET} TMPFILE=`mktemp -u` -msggrep -v -N "doc/source/data/*.csv" \ - ${DIRECTORY}/build/gettext/atc-stats.pot > $TMPFILE -mv -f $TMPFILE ${DIRECTORY}/build/gettext/atc-stats.pot +msggrep -v -N "../../source/data/*.csv" ${TARGET} > $TMPFILE +mv -f $TMPFILE ${TARGET} +msgfmt --statistics -o /dev/null ${TARGET}