From a0b3eae26ebdbc9545b8b15f7c495c762359ab517836e4b37e3a14d97ef52e74 Mon Sep 17 00:00:00 2001 From: Stephan Kulow Date: Wed, 14 Mar 2012 10:19:44 +0000 Subject: [PATCH] Accepting request 109136 from home:vuntz:branches:Base:System Fix find-lang to work with new XDG help system OBS-URL: https://build.opensuse.org/request/show/109136 OBS-URL: https://build.opensuse.org/package/show/Base:System/rpm?expand=0&rev=191 --- findlang-new-help-fix.diff | 15 +++++++++++++++ findlang-new-help.diff | 28 ++++++++++++++++++++++++++++ langnoc.diff | 37 +++++++++++++++++++++++++------------ python3-rpm.spec | 1 - remove-translations.diff | 12 +++++++++--- rpm-python.spec | 1 - rpm.changes | 13 +++++++++++++ rpm.spec | 22 ++++++++++++---------- 8 files changed, 102 insertions(+), 27 deletions(-) create mode 100644 findlang-new-help-fix.diff create mode 100644 findlang-new-help.diff diff --git a/findlang-new-help-fix.diff b/findlang-new-help-fix.diff new file mode 100644 index 0000000..3ef04b2 --- /dev/null +++ b/findlang-new-help-fix.diff @@ -0,0 +1,15 @@ +Index: scripts/find-lang.sh +=================================================================== +--- scripts/find-lang.sh.orig ++++ scripts/find-lang.sh +@@ -139,8 +139,8 @@ s:%lang(C) :: + + find $TOP_DIR -type d|sed ' + s:'"$TOP_DIR"':: +-'"$NO_ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\(/'"$NAME"'\)$:%lang(\2) %doc \1\2\3/: +-'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3/: ++'"$NO_ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/'"$NAME"'\)$:%lang(\2) %doc \1\2\3\4/: ++'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/: + s:^\([^%].*\):: + s:%lang(C) :: + /^$/d' >> $MO_NAME_NEW diff --git a/findlang-new-help.diff b/findlang-new-help.diff new file mode 100644 index 0000000..32b24b2 --- /dev/null +++ b/findlang-new-help.diff @@ -0,0 +1,28 @@ +From 6047ddf6aa984a65e334450e04d272631894b039 Mon Sep 17 00:00:00 2001 +From: Panu Matilainen +Date: Wed, 7 Mar 2012 11:31:15 +0200 +Subject: [PATCH] Teach find-lang about the new gnome help layout (RhBug:736523) + +--- + scripts/find-lang.sh | 8 ++++++++ + 1 files changed, 8 insertions(+), 0 deletions(-) + +Index: scripts/find-lang.sh +=================================================================== +--- scripts/find-lang.sh.orig ++++ scripts/find-lang.sh +@@ -122,6 +122,14 @@ s:%lang(C) :: + + find $TOP_DIR -type d|sed ' + s:'"$TOP_DIR"':: ++'"$NO_ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\(/'"$NAME"'\)$:%lang(\2) %doc \1\2\3/: ++'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3/: ++s:^\([^%].*\):: ++s:%lang(C) :: ++/^$/d' >> $MO_NAME_NEW ++ ++find $TOP_DIR -type d|sed ' ++s:'"$TOP_DIR"':: + '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1: + '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\):: + '"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2: diff --git a/langnoc.diff b/langnoc.diff index a65341b..be3e1fc 100644 --- a/langnoc.diff +++ b/langnoc.diff @@ -1,6 +1,8 @@ ---- ./macros.in.orig 2011-07-18 17:18:24.000000000 +0000 -+++ ./macros.in 2011-07-18 17:18:36.000000000 +0000 -@@ -1249,6 +1249,7 @@ EOF +Index: macros.in +=================================================================== +--- macros.in.orig ++++ macros.in +@@ -1253,6 +1253,7 @@ EOF # %files -f %{name}.lang # %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot} @@ -8,8 +10,10 @@ # Commands + opts to use for retrieving remote files # Proxy opts can be set through --httpproxy/--httpport popt aliases, ---- ./scripts/find-lang.sh.orig 2011-07-18 17:18:24.000000000 +0000 -+++ ./scripts/find-lang.sh 2011-07-18 17:18:36.000000000 +0000 +Index: scripts/find-lang.sh +=================================================================== +--- scripts/find-lang.sh.orig ++++ scripts/find-lang.sh @@ -62,6 +62,8 @@ MO= MO_NAME=$NAME.lang ALL_NAME=# @@ -34,11 +38,20 @@ * ) MO_NAME=${1} shift -@@ -117,27 +127,32 @@ s:'"$TOP_DIR"':: +@@ -134,6 +144,8 @@ s:'"$TOP_DIR"':: '"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3: '"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3: s:^\([^%].*\):: +'"$ONLY_C"'/%lang(C)/!d ++'"$NO_C"'/%lang(C)/d + s:%lang(C) :: + /^$/d' >> $MO_NAME_NEW + +@@ -142,27 +154,32 @@ s:'"$TOP_DIR"':: + '"$NO_ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/'"$NAME"'\)$:%lang(\2) %doc \1\2\3\4/: + '"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/: + s:^\([^%].*\):: ++'"$ONLY_C"'/%lang(C)/!d +'"$NO_C"'/%lang(C)/d s:%lang(C) :: /^$/d' >> $MO_NAME_NEW @@ -71,7 +84,7 @@ /^$/d' >> $MO_NAME_NEW find $TOP_DIR -type f|sed ' -@@ -145,6 +160,8 @@ s:'"$TOP_DIR"':: +@@ -170,6 +187,8 @@ s:'"$TOP_DIR"':: '"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'/'"$NAME"'-\([^/.]\+\)\.omf\):%lang(\2) \1: '"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1: s:^[^%].*:: @@ -80,7 +93,7 @@ s:%lang(C) :: /^$/d' >> $MO_NAME_NEW -@@ -157,6 +174,8 @@ s:'"$TOP_DIR"':: +@@ -182,6 +201,8 @@ s:'"$TOP_DIR"':: '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\):: '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3: s:^\([^%].*\):: @@ -89,7 +102,7 @@ s:%lang(C) :: /^$/d' >> $MO_NAME_NEW fi -@@ -170,6 +189,8 @@ s:'"$TOP_DIR"':: +@@ -195,6 +216,8 @@ s:'"$TOP_DIR"':: '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\):: '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3: s:^\([^%].*\):: @@ -98,7 +111,7 @@ s:%lang(C) :: /^$/d' >> $MO_NAME_NEW fi -@@ -182,6 +203,8 @@ s:'"$TOP_DIR"':: +@@ -207,6 +230,8 @@ s:'"$TOP_DIR"':: '"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}[_@].*\)\.qm$\):%lang(\2) \1: '"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1: s:^[^%].*:: @@ -107,7 +120,7 @@ s:%lang(C) :: /^$/d' >> $MO_NAME_NEW -@@ -190,6 +213,8 @@ s:'"$TOP_DIR"':: +@@ -215,6 +240,8 @@ s:'"$TOP_DIR"':: '"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\):: '"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*: s:^\([^%].*\):: @@ -116,7 +129,7 @@ s:%lang(C) :: /^$/d' >> $MO_NAME_NEW -@@ -197,6 +222,8 @@ find $TOP_DIR -type f -o -type l|sed ' +@@ -222,6 +249,8 @@ find $TOP_DIR -type f -o -type l|sed ' s:'"$TOP_DIR"':: '"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*: s:^\([^%].*\):: diff --git a/python3-rpm.spec b/python3-rpm.spec index 6bd2afc..5b826aa 100644 --- a/python3-rpm.spec +++ b/python3-rpm.spec @@ -16,7 +16,6 @@ # - Name: python3-rpm Version: 4.9.1.2 Release: 0 diff --git a/remove-translations.diff b/remove-translations.diff index afff73b..99a252f 100644 --- a/remove-translations.diff +++ b/remove-translations.diff @@ -1,8 +1,8 @@ Index: scripts/find-lang.sh =================================================================== ---- scripts/find-lang.sh.orig 2011-12-09 14:46:32.443023115 +0100 -+++ scripts/find-lang.sh 2011-12-09 14:46:52.086092200 +0100 -@@ -122,6 +122,17 @@ fi +--- scripts/find-lang.sh.orig ++++ scripts/find-lang.sh +@@ -112,6 +112,23 @@ fi MO_NAME_NEW=$MO_NAME.tmp.$$ rm -f $MO_NAME_NEW @@ -16,6 +16,12 @@ Index: scripts/find-lang.sh + 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 -n "removing help translation /usr/share/help/$dir" ++ rm -rf $TOP_DIR/usr/share/help/$dir ++ fi ++done + find $TOP_DIR -type f -o -type l|sed ' s:'"$TOP_DIR"':: diff --git a/rpm-python.spec b/rpm-python.spec index fe0857e..5af67c9 100644 --- a/rpm-python.spec +++ b/rpm-python.spec @@ -16,7 +16,6 @@ # - Name: rpm-python Version: 4.9.1.2 Release: 0 diff --git a/rpm.changes b/rpm.changes index 51de8e6..124edb0 100644 --- a/rpm.changes +++ b/rpm.changes @@ -1,3 +1,16 @@ +------------------------------------------------------------------- +Tue Mar 13 14:40:47 UTC 2012 - vuntz@opensuse.org + +- Add findlang-new-help.diff: patch based on git commit 6047ddf6 to + make find-lang know about the new gnome help layout. +- Add findlang-new-help-fix.diff: additional fix to above patch, so + that locales with a territory work too (for instance, fr_FR). +- Rebase langnoc.diff on top of findlang-new-help.diff, so that we + won't need to rebase it with a future release containing + findlang-new-help.diff. +- Update remove-translations.diff to also remove help translations + for languages that are not supported by the filesystem package. + ------------------------------------------------------------------- Tue Jan 31 11:06:52 UTC 2012 - lnussel@suse.de diff --git a/rpm.spec b/rpm.spec index 04d3e74..c478e33 100644 --- a/rpm.spec +++ b/rpm.spec @@ -16,7 +16,6 @@ # - Name: rpm BuildRequires: binutils BuildRequires: bzip2 @@ -118,7 +117,7 @@ Patch61: noprereqdeprec.diff Patch62: pythondeps.diff Patch63: fontprovides.diff Patch64: rpm-gst-provides.patch -Patch65: langnoc.diff +Patch65: findlang-new-help.diff Patch66: initscriptsprov.diff Patch67: remove-translations.diff Patch68: no_rep_autop.diff @@ -136,6 +135,8 @@ Patch79: headerchk.diff Patch80: rpm-deptracking.patch Patch81: python3-abi-kind.diff Patch82: perl-python-attr.patch +Patch83: findlang-new-help-fix.diff +Patch84: langnoc.diff BuildRoot: %{_tmppath}/%{name}-%{version}-build # # avoid bootstrapping problem @@ -169,19 +170,20 @@ need an intimate knowledge of RPM packages in order to function. Summary: Tools and Scripts to create rpm packages Group: System/Packages Requires: rpm = %{version} -Provides: rpmbuild rpm:%_bindir/rpmbuild +Provides: rpm:%_bindir/rpmbuild +Provides: rpmbuild # SUSE's build essentials -Requires: bzip2 -Requires: xz -Requires: gzip Requires: binutils -Requires: make +Requires: bzip2 +Requires: findutils Requires: gcc Requires: gettext-tools -Requires: findutils -Requires: patch Requires: glibc-devel +Requires: gzip +Requires: make +Requires: patch Requires: perl-base +Requires: xz %description build If you want to build a rpm, you need this package. It provides rpmbuild @@ -208,7 +210,7 @@ rm -f rpmdb/db.h %patch -P 50 -P 51 -P 52 -P 53 -P 54 -P 55 -P 56 -P 57 -P 58 -P 59 %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 +%patch -P 80 -P 81 -P 82 -P 83 -P 84 #chmod 755 scripts/find-supplements{,.ksyms} #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/firmware.prov