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
This commit is contained in:
Stephan Kulow 2012-03-14 10:19:44 +00:00 committed by Git OBS Bridge
parent cf5e044e00
commit a0b3eae26e
8 changed files with 102 additions and 27 deletions

View File

@ -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

28
findlang-new-help.diff Normal file
View File

@ -0,0 +1,28 @@
From 6047ddf6aa984a65e334450e04d272631894b039 Mon Sep 17 00:00:00 2001
From: Panu Matilainen <pmatilai@redhat.com>
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:

View File

@ -1,6 +1,8 @@
--- ./macros.in.orig 2011-07-18 17:18:24.000000000 +0000 Index: macros.in
+++ ./macros.in 2011-07-18 17:18:36.000000000 +0000 ===================================================================
@@ -1249,6 +1249,7 @@ EOF --- macros.in.orig
+++ macros.in
@@ -1253,6 +1253,7 @@ EOF
# %files -f %{name}.lang # %files -f %{name}.lang
# #
%find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot} %find_lang %{_rpmconfigdir}/find-lang.sh %{buildroot}
@ -8,8 +10,10 @@
# Commands + opts to use for retrieving remote files # Commands + opts to use for retrieving remote files
# Proxy opts can be set through --httpproxy/--httpport popt aliases, # Proxy opts can be set through --httpproxy/--httpport popt aliases,
--- ./scripts/find-lang.sh.orig 2011-07-18 17:18:24.000000000 +0000 Index: scripts/find-lang.sh
+++ ./scripts/find-lang.sh 2011-07-18 17:18:36.000000000 +0000 ===================================================================
--- scripts/find-lang.sh.orig
+++ scripts/find-lang.sh
@@ -62,6 +62,8 @@ MO= @@ -62,6 +62,8 @@ MO=
MO_NAME=$NAME.lang MO_NAME=$NAME.lang
ALL_NAME=# ALL_NAME=#
@ -34,11 +38,20 @@
* ) * )
MO_NAME=${1} MO_NAME=${1}
shift 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: '"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3: '"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
s:^\([^%].*\):: s:^\([^%].*\)::
+'"$ONLY_C"'/%lang(C)/!d +'"$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 +'"$NO_C"'/%lang(C)/d
s:%lang(C) :: s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW /^$/d' >> $MO_NAME_NEW
@ -71,7 +84,7 @@
/^$/d' >> $MO_NAME_NEW /^$/d' >> $MO_NAME_NEW
find $TOP_DIR -type f|sed ' 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: '"$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: '"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
s:^[^%].*:: s:^[^%].*::
@ -80,7 +93,7 @@
s:%lang(C) :: s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW /^$/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.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3: '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\):: s:^\([^%].*\)::
@ -89,7 +102,7 @@
s:%lang(C) :: s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW /^$/d' >> $MO_NAME_NEW
fi 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.\_\-]\+/\)::
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3: '"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
s:^\([^%].*\):: s:^\([^%].*\)::
@ -98,7 +111,7 @@
s:%lang(C) :: s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW /^$/d' >> $MO_NAME_NEW
fi 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:
'"$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:^[^%].*:: s:^[^%].*::
@ -107,7 +120,7 @@
s:%lang(C) :: s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW /^$/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]\+/\)::
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*: '"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
s:^\([^%].*\):: s:^\([^%].*\)::
@ -116,7 +129,7 @@
s:%lang(C) :: s:%lang(C) ::
/^$/d' >> $MO_NAME_NEW /^$/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"':: s:'"$TOP_DIR"'::
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*: '"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
s:^\([^%].*\):: s:^\([^%].*\)::

View File

@ -16,7 +16,6 @@
# #
Name: python3-rpm Name: python3-rpm
Version: 4.9.1.2 Version: 4.9.1.2
Release: 0 Release: 0

View File

@ -1,8 +1,8 @@
Index: scripts/find-lang.sh Index: scripts/find-lang.sh
=================================================================== ===================================================================
--- scripts/find-lang.sh.orig 2011-12-09 14:46:32.443023115 +0100 --- scripts/find-lang.sh.orig
+++ scripts/find-lang.sh 2011-12-09 14:46:52.086092200 +0100 +++ scripts/find-lang.sh
@@ -122,6 +122,17 @@ fi @@ -112,6 +112,23 @@ fi
MO_NAME_NEW=$MO_NAME.tmp.$$ MO_NAME_NEW=$MO_NAME.tmp.$$
rm -f $MO_NAME_NEW rm -f $MO_NAME_NEW
@ -16,6 +16,12 @@ Index: scripts/find-lang.sh
+ rm -rf $TOP_DIR/usr/share/locale/$dir + rm -rf $TOP_DIR/usr/share/locale/$dir
+ fi + fi
+done +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 ' find $TOP_DIR -type f -o -type l|sed '
s:'"$TOP_DIR"':: s:'"$TOP_DIR"'::

View File

@ -16,7 +16,6 @@
# #
Name: rpm-python Name: rpm-python
Version: 4.9.1.2 Version: 4.9.1.2
Release: 0 Release: 0

View File

@ -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 Tue Jan 31 11:06:52 UTC 2012 - lnussel@suse.de

View File

@ -16,7 +16,6 @@
# #
Name: rpm Name: rpm
BuildRequires: binutils BuildRequires: binutils
BuildRequires: bzip2 BuildRequires: bzip2
@ -118,7 +117,7 @@ Patch61: noprereqdeprec.diff
Patch62: pythondeps.diff Patch62: pythondeps.diff
Patch63: fontprovides.diff Patch63: fontprovides.diff
Patch64: rpm-gst-provides.patch Patch64: rpm-gst-provides.patch
Patch65: langnoc.diff Patch65: findlang-new-help.diff
Patch66: initscriptsprov.diff Patch66: initscriptsprov.diff
Patch67: remove-translations.diff Patch67: remove-translations.diff
Patch68: no_rep_autop.diff Patch68: no_rep_autop.diff
@ -136,6 +135,8 @@ Patch79: headerchk.diff
Patch80: rpm-deptracking.patch Patch80: rpm-deptracking.patch
Patch81: python3-abi-kind.diff Patch81: python3-abi-kind.diff
Patch82: perl-python-attr.patch Patch82: perl-python-attr.patch
Patch83: findlang-new-help-fix.diff
Patch84: langnoc.diff
BuildRoot: %{_tmppath}/%{name}-%{version}-build BuildRoot: %{_tmppath}/%{name}-%{version}-build
# #
# avoid bootstrapping problem # 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 Summary: Tools and Scripts to create rpm packages
Group: System/Packages Group: System/Packages
Requires: rpm = %{version} Requires: rpm = %{version}
Provides: rpmbuild rpm:%_bindir/rpmbuild Provides: rpm:%_bindir/rpmbuild
Provides: rpmbuild
# SUSE's build essentials # SUSE's build essentials
Requires: bzip2
Requires: xz
Requires: gzip
Requires: binutils Requires: binutils
Requires: make Requires: bzip2
Requires: findutils
Requires: gcc Requires: gcc
Requires: gettext-tools Requires: gettext-tools
Requires: findutils
Requires: patch
Requires: glibc-devel Requires: glibc-devel
Requires: gzip
Requires: make
Requires: patch
Requires: perl-base Requires: perl-base
Requires: xz
%description build %description build
If you want to build a rpm, you need this package. It provides rpmbuild 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 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 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 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-supplements{,.ksyms}
#chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms #chmod 755 scripts/find-provides.ksyms scripts/find-requires.ksyms
#chmod 755 scripts/firmware.prov #chmod 755 scripts/firmware.prov