]> git.pld-linux.org Git - packages/dokuwiki-plugin-cacherevisionseraser.git/blobdiff - dokuwiki-find-lang.sh
- add ca-va -> ca_VA
[packages/dokuwiki-plugin-cacherevisionseraser.git] / dokuwiki-find-lang.sh
index 517125a6c1fb9c6b581635cbb7ebfeca5fd9b878..db54c8399532cb39c53ddfbbeffc4ce530910278 100644 (file)
@@ -1,9 +1,14 @@
 #!/bin/sh
+PROG=${0##*/}
 dir=$RPM_BUILD_ROOT/usr/share/dokuwiki
 langfile=$1
+tmp=$(mktemp) || exit 1
+rc=0
 
-> $langfile
-find $dir -type d -name lang | while read dir; do
+find $dir -type d -name lang > $tmp
+
+echo '%defattr(644,root,root,755)' > $langfile
+while read dir; do
        echo "%dir ${dir#$RPM_BUILD_ROOT}" >> $langfile
        for dir in $dir/*; do
                lang=${dir##*/}
@@ -15,11 +20,28 @@ find $dir -type d -name lang | while read dir; do
                pt-br)
                        lang=pt_BR
                ;;
+               sl-si)
+                       lang=sl
+               ;;
+               id-ni)
+                       lang=id_NI
+               ;;
+               ca-va)
+                       lang=ca_VA
+               ;;
                *-*)
-                       : Need mapping for $lang!
-                       exit 1
+                       echo >&2 "ERROR: Need mapping for $lang!"
+                       rc=1
                ;;
                esac
                echo "%lang($lang) ${dir#$RPM_BUILD_ROOT}" >> $langfile
        done
-done
+done < $tmp
+
+if [ "$(egrep -v '(^%defattr|^$)' $langfile | wc -l)" -le 0 ]; then
+       echo >&2 "$PROG: Error: international files not found!"
+       rc=1
+fi
+
+rm -f $tmp
+exit $rc
This page took 0.074025 seconds and 4 git commands to generate.