]> git.pld-linux.org Git - packages/opera.git/blob - find-lang.sh
- up to 109.0.5097.45
[packages/opera.git] / find-lang.sh
1 #!/bin/sh
2 PROG=${0##*/}
3 if [ $# = 2 ]; then
4         # for using same syntax as rpm own find-lang
5         RPM_BUILD_ROOT=$1
6         shift
7 fi
8 dir=$RPM_BUILD_ROOT@localedir@
9 langfile=$1
10 tmp=$(mktemp) || exit 1
11 rc=0
12
13 find $dir -name '*.pak' > $tmp
14
15 echo '%defattr(644,root,root,755)' > $langfile
16 while read file; do
17         lang=${file##*/}
18         lang=${lang%.pak}
19         case "$lang" in
20         zh-TW)
21                 lang=zh_TW
22         ;;
23         zh-CN)
24                 lang=zh_CN
25         ;;
26         en-US|en-GB)
27                 lang=en
28         ;;
29         pt-BR)
30                 lang=pt_BR
31         ;;
32         fr-CA)
33                 lang=fr_CA
34         ;;
35         pt-PT)
36                 lang=pt
37         ;;
38         es-419)
39                 lang=es_LA
40         ;;
41         *-*)
42                 echo >&2 "ERROR: Need mapping for $lang!"
43                 rc=1
44         ;;
45         esac
46         echo "%lang($lang) ${file#$RPM_BUILD_ROOT}" >> $langfile
47 done < $tmp
48
49 if [ "$(grep -Ev '(^%defattr|^$)' $langfile | wc -l)" -le 0 ]; then
50         echo >&2 "$PROG: Error: international files not found!"
51         rc=1
52 fi
53
54 rm -f $tmp
55 exit $rc
This page took 0.13315 seconds and 3 git commands to generate.