[packages/rpm-build-macros] find lang 1.40: add --with-django; previous change (701db50) removed

glen glen at pld-linux.org
Mon Apr 24 00:27:58 CEST 2017


commit 1378be66882ce155be58bfc2084472156d437288
Author: Elan Ruusamäe <glen at delfi.ee>
Date:   Mon Apr 24 01:26:55 2017 +0300

    find lang 1.40: add --with-django; previous change (701db50) removed

 find-lang.sh          | 17 +++++++++++++++--
 rpm-build-macros.spec |  4 ++--
 2 files changed, 17 insertions(+), 4 deletions(-)
---
diff --git a/rpm-build-macros.spec b/rpm-build-macros.spec
index 5cc1ae3..0de05c1 100644
--- a/rpm-build-macros.spec
+++ b/rpm-build-macros.spec
@@ -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
diff --git a/find-lang.sh b/find-lang.sh
index a15592e..7befc80 100755
--- a/find-lang.sh
+++ b/find-lang.sh
@@ -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
================================================================

---- gitweb:

http://git.pld-linux.org/gitweb.cgi/packages/rpm-build-macros.git/commitdiff/1378be66882ce155be58bfc2084472156d437288



More information about the pld-cvs-commit mailing list