File: get-iso-codes

package info (click to toggle)
geneweb 6.08%2Bgit20181019%2Bdfsg-2
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 9,460 kB
  • sloc: ml: 75,564; sh: 1,282; makefile: 708; perl: 27
file content (29 lines) | stat: -rw-r--r-- 857 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
28
29
#!/bin/sh
#
# Get ISO codes from the iso-codes package and extract translations
#
rm -rf debian/iso-codes || true
mkdir debian/iso-codes

echo "Grabbing ISO-639-2 languages names:"
for i in `find /usr/share/locale/ -name iso_639-2.mo` ; do
  language=`echo $i | cut -f5 -d/`
  echo -n "$language"...
  # If a file exists in iso-codes.updated, then use it
  # else extract translations from the iso-codes package
  if [ ! -f iso-codes.updates/$language.po ] ; then
    msgunfmt $i >debian/iso-codes/${language}.po
  else
    cp iso-codes.updates/$language.po debian/iso-codes
  fi
  echo " done."
done

for i in `find iso-codes.updates -name \*.po -maxdepth 1 2>/dev/null` ; do
  if [ ! -f debian/iso-codes/`basename $i` ] ; then
    cp $i debian/iso-codes
  fi
done

# Delete all files of size 0.
find debian/iso-codes -size 0 | xargs --no-run-if-empty rm