]> git.pld-linux.org Git - packages/rpm-build-macros.git/commitdiff
find lang 1.40: add --with-django; previous change (701db50) removed auto/th/rpm-build-macros-1.723-3
authorElan Ruusamäe <glen@delfi.ee>
Sun, 23 Apr 2017 22:26:55 +0000 (01:26 +0300)
committerElan Ruusamäe <glen@delfi.ee>
Sun, 23 Apr 2017 22:27:25 +0000 (01:27 +0300)
find-lang.sh
rpm-build-macros.spec

index a15592e4e24fea2d398f7052873c7deb86b5bd13..7befc80566e98b94a11b23d675ad83fd884ec436 100755 (executable)
@@ -36,7 +36,7 @@
 #   * start support for KDE help files
 
 PROG=${0##*/}
-VERSION=1.39
+VERSION=1.40
 
 usage () {
 cat <<EOF
@@ -55,6 +55,7 @@ Additional options:
   --with-kde           find KDE help files
   --with-omf           find OMF files
   --with-qm                    find QT .qm files
+  --with-django                find translations in Django project
   --all-name           match all package/domain names
   --without-mo         skip *.mo locale files
   -o NAME                      output will be saved to NAME
@@ -88,6 +89,7 @@ MATE='#'
 KDE='#'
 OMF='#'
 QM='#'
+DJANGO='#'
 MO=''
 OUTPUT=$NAME.lang
 ALL_NAME='#'
@@ -120,6 +122,11 @@ while test $# -gt 0; do
                QM=''
                shift
                ;;
+       --with-django)
+               echo >&2 "$PROG: Enabling with Django"
+               DJANGO=''
+               shift
+               ;;
        --without-mo)
                echo >&2 "$PROG: Disabling .mo files"
                MO='#'
@@ -191,11 +198,17 @@ fi
                cat __find.files
        fi
 ) | sed '
-'"$ALL_NAME$MO"'s:\(.*/share/locale/\|.*/share/python.*/locale/\)\([^/@]\+\)\(@quot\|@boldquot\)\?\(@[^/]*\)\?\(/.*\.mo$\):%lang(\2\4) \1\2\3\4\5:
+'"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/@]\+\)\(@quot\|@boldquot\)\?\(@[^/]*\)\?\(/.*\.mo$\):%lang(\2\4) \1\2\3\4\5:
 '"$NO_ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/@]\+\)\(@quot\|@boldquot\)\?\(@[^/]*\)\?\(/.*/'"$NAME"'\.mo$\):%lang(\2\4) \1\2\3\4\5:
 /^[^%]/d
 s:%lang(C) ::' >> $MO_NAME
 
+# Django
+cat __find.dirs | sed -r -e '
+'"$DJANGO"'s:(.+/share/python.+/locale/)([^/@]+)(@quot|@boldquot)?(@[^/]*)?$:%lang(\2\4) \1\2\3\4:
+/^[^%]/d
+s:%lang(C) ::' >> $MO_NAME
+
 # .omf
 (
        if [ "$ALL_NAME" ]; then
index 5cc1ae374df0558bb3994e2d8c5d78a83dc83e59..0de05c170a1bf01783b3f1ca68e0437ad7d4fd61 100644 (file)
@@ -1,10 +1,10 @@
 %define                rpm_macros_rev  1.723
-%define                find_lang_rev   1.39
+%define                find_lang_rev   1.40
 Summary:       PLD Linux RPM build macros
 Summary(pl.UTF-8):     Makra do budowania pakietów RPM dla Linuksa PLD
 Name:          rpm-build-macros
 Version:       %{rpm_macros_rev}
-Release:       2
+Release:       3
 License:       GPL
 Group:         Development/Building
 Source0:       rpm.macros
This page took 0.039494 seconds and 4 git commands to generate.