From b0284ad06a55efcbe749d04e4cded85beab26197 Mon Sep 17 00:00:00 2001 From: Peter Eisentraut Date: Wed, 13 Jul 2022 08:35:03 +0200 Subject: [PATCH] cp-po: Add support for po/LINGUAS files --- cp-po | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/cp-po b/cp-po index d4ae928..4e6d55b 100755 --- a/cp-po +++ b/cp-po @@ -213,10 +213,18 @@ if $update_target_tree; then for y in $nls_mks; do targetdir=$(echo $y | sed 's,nls\.mk$,po,') langs=$(echo $(cd $targetdir && ls *.po | sed 's/\.po$//')) - sed -e 's/\(AVAIL_LANGUAGES.*:*=\).*$/\1 '"$langs/" $y >$y.new - mv $y.new $y + if [ -e "$targetdir/LINGUAS" ]; then + echo "$langs" >"$targetdir/LINGUAS" + else + sed -e 's/\(AVAIL_LANGUAGES.*:*=\).*$/\1 '"$langs/" $y >$y.new + mv $y.new $y + fi if $git_mode; then - git add $(echo "$y" | sed "s,^$destdir/,,") + if [ -e "$targetdir/LINGUAS" ]; then + git add $(echo "$targetdir/LINGUAS" | sed "s,^$destdir/,,") + else + git add $(echo "$y" | sed "s,^$destdir/,,") + fi fi done fi -- 2.39.5