maint: fix hint file processing

Signed-off-by: Yury V. Zaytsev <yury@shurup.com>
This commit is contained in:
Yury V. Zaytsev 2017-11-18 19:33:50 +01:00
parent 98c4bc3a08
commit 9d8c780934

View File

@ -33,8 +33,19 @@ source "${MC_SOURCE_ROOT_DIR}/maint/utils/sync-transifex/functions"
#*** file scope functions **********************************************
removeExtraBackSlash() {
processHintFiles() {
# Remove extra backslash
sed -i -e 's/\\-/-/g' ${MC_SOURCE_ROOT_DIR}/doc/hints/l10n/mc.hint.*
# Remove extra line breaks
for fn in ${MC_SOURCE_ROOT_DIR}/doc/hints/l10n/mc.hint.*; do
awk '/^$/ { print "\n"; } /./ { printf("%s ", $0); } END { print; }' $fn > $fn.tmp
sed -e 's/[[:space:]]*$//' < $fn.tmp > $fn
perl -i -0pe 's/\n+\Z/\n/' $fn
rm $fn.tmp
done
}
#*** main code *********************************************************
@ -47,4 +58,4 @@ createPo4A "mc.hint"
convertFromPoToText "${WORK_DIR}" "mc.hint"
removeExtraBackSlash
processHintFiles