From 1e0c9ffdb895e63beb60d6d74ecb8216f14cf039094137c135553f14437c2972 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Wed, 20 Nov 2013 11:31:44 +0000 Subject: [PATCH] Accepting request 206471 from home:saschpe:branches:Base:System Hi Micha, please provide some feedback on the following patch. I would like to properly mark Python translations that are found in %python_sitelib/sitearch. It's sort of common that Python modules have their i18n/i10n files inside their module directory (and not in /usr/share/locale). - Add find-lang-python.patch: Support for finding translations in %python_sitelib/python_sitearch. OBS-URL: https://build.opensuse.org/request/show/206471 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=306 --- find-lang-python.patch | 90 ++++++++++++++++++++++++++++++++++++++++++ rpm.changes | 6 +++ rpm.spec | 3 +- 3 files changed, 98 insertions(+), 1 deletion(-) create mode 100644 find-lang-python.patch diff --git a/find-lang-python.patch b/find-lang-python.patch new file mode 100644 index 0000000..c0a616f --- /dev/null +++ b/find-lang-python.patch @@ -0,0 +1,90 @@ +Support for finding Python translation files in %python_sitelib +or %python_sitearch. + +Sascha Peilicke +--- scripts/find-lang.sh 2013-09-27 20:04:33.000000000 +0200 ++++ scripts/find-lang.sh-new 2013-11-07 18:35:39.879014359 +0100 +@@ -32,6 +32,7 @@ + Additional options: + --without-gnome do not find GNOME help files + --without-kde do not find KDE help files ++ --with-python find Python translation files + --with-qt find Qt translation files + --with-man find localized man pages + --all-name match all package/domain names +@@ -56,6 +57,7 @@ + + GNOME= + KDE= ++PYTHON=# + QT=# + MAN=# + MO= +@@ -83,6 +85,10 @@ + KDE=# + shift + ;; ++ --with-python ) ++ PYTHON= ++ shift ++ ;; + --with-qt ) + QT= + shift +@@ -122,21 +128,25 @@ + rm -f $MO_NAME_NEW + + # remove languages we do not yet support - but give out statistics +-find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do +- if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then +- find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do +- echo -n "removing translation $file: " +- msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null - ++if [ -d "$TOP_DIR/usr/share/locale/" ] ; then ++ find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do ++ if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then ++ find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do ++ echo -n "removing translation $file: " ++ msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null - ++ done ++ rm -rf $TOP_DIR/usr/share/locale/$dir ++ fi + done +- rm -rf $TOP_DIR/usr/share/locale/$dir +- fi +-done +-find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do +- if ! rpm -ql filesystem | egrep -q "/usr/share/help/$dir"$; then +- echo "removing help translation /usr/share/help/$dir" +- rm -rf $TOP_DIR/usr/share/help/$dir +- fi +-done ++fi ++if [ -d "$TOP_DIR/usr/share/help/" ] ; then ++ find $TOP_DIR/usr/share/help/ -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/help/'::; /^$/d' | while read dir; do ++ if ! rpm -ql filesystem | egrep -q "/usr/share/help/$dir"$; then ++ echo "removing help translation /usr/share/help/$dir" ++ rm -rf $TOP_DIR/usr/share/help/$dir ++ fi ++ done ++fi + + find "$TOP_DIR" -type f -o -type l|sed ' + s:'"$TOP_DIR"':: +@@ -187,6 +197,16 @@ + s:^[^%].*:: + '"$ONLY_C"'/%lang(C)/!d + '"$NO_C"'/%lang(C)/d ++s:%lang(C) :: ++/^$/d' >> $MO_NAME_NEW ++ ++find "$TOP_DIR" -type f -o -type l|sed ' ++s:'"$TOP_DIR"':: ++'"$NO_ALL_NAME$PYTHON"'s:\(/usr/lib.*/python.*/site-packages/'"$NAME"'$\):%dir \1: ++'"$ALL_NAME$PYTHON"'s:\(/usr/lib.*/python.*/site-packages/[a-zA-Z0-9.\_\-]\+$\):%dir \1: ++s:^[^%].*:: ++'"$ONLY_C"'/%lang(C)/!d ++'"$NO_C"'/%lang(C)/d + s:%lang(C) :: + /^$/d' >> $MO_NAME_NEW + diff --git a/rpm.changes b/rpm.changes index 381c54f..0ab5988 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,9 @@ +------------------------------------------------------------------- +Mon Nov 11 10:02:43 UTC 2013 - speilicke@suse.com + +- Add find-lang-python.patch: Support for finding translations in + %python_sitelib/python_sitearch. + ------------------------------------------------------------------- Wed Nov 6 18:07:49 UTC 2013 - dvaleev@suse.com diff --git a/rpm.spec b/rpm.spec index 8bf41cf..c182e91 100644 --- a/rpm.spec +++ b/rpm.spec @@ -145,6 +145,7 @@ Patch90: appdata_provides.diff #upstream commit cf07feda05822377d62b973adc4010c0d7f9eaa0 #upstream commit ef1497b1f81966fed56f008bc8ee8ba42102efd6 Patch91: ppc64le.diff +Patch92: find-lang-python.patch Patch6464: auto-config-update-aarch64.diff Patch68000: m68k.patch Patch68001: debugedit-m68k.patch @@ -234,7 +235,7 @@ rm -f rpmdb/db.h %patch -P 60 -P 61 -P 62 -P 63 -P 64 -P 65 -P 66 -P 67 -P 68 -P 69 %patch -P 70 -P 71 -P 72 -P 73 -P 74 -P 75 -P 76 -P 77 -P 78 -P 79 %patch -P 80 -P 81 -P 82 -P 83 -P 84 -P 85 -P 86 -P 87 -P 88 -P 89 -%patch -P 90 -P 91 +%patch -P 90 -P 91 -P 92 %ifarch aarch64 %patch6464