From: Peter Eisentraut Date: Wed, 13 Jul 2022 06:35:03 +0000 (+0200) Subject: cp-po: Add support for po/LINGUAS files X-Git-Url: http://git.postgresql.org/gitweb/static/backend_dirs.html?a=commitdiff_plain;h=b0284ad06a55efcbe749d04e4cded85beab26197;p=pgtranslation%2Fadmin.git cp-po: Add support for po/LINGUAS files --- 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