File: update.sh

package info (click to toggle)
pppconfig 2.3.21
  • links: PTS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 1,464 kB
  • ctags: 82
  • sloc: perl: 1,462; sh: 152; makefile: 65
file content (27 lines) | stat: -rwxr-xr-x 645 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#!/bin/sh

cd po

xgettext --language=Perl --default-domain=pppconfig --directory=.. \
	 --add-comments --keyword=_ --keyword=N_ \
	 --files-from=POTFILES.in && test ! -f pppconfig.po \
	 || ( rm -f templates.pot && mv pppconfig.po templates.pot )

# Moving along..

catalogs=`ls *.po`
for cat in $catalogs; do
  lang=`echo $cat | sed 's/\.po$//'`
  mv $cat $lang.old.po
  echo "$lang:"
  if msgmerge --previous $lang.old.po templates.pot -o $cat; then
    rm -f $lang.old.po
  else
    echo "msgmerge for $cat failed!"
    if cmp --quiet $cat $lang.old.po ; then
      rm -f $lang.old.po
    else
      mv -f $lang.old.po $cat
    fi
  fi
done