This commit is contained in:
committed by
Git OBS Bridge
parent
64a650bf09
commit
8c64a58df3
109
findlang.diff
109
findlang.diff
@@ -1,20 +1,22 @@
|
||||
--- scripts/find-lang.sh 2004-06-20 20:55:19.000000000 +0200
|
||||
+++ scripts/find-lang.sh 2008-03-21 18:13:21.489944000 +0100
|
||||
@@ -28,10 +28,10 @@
|
||||
Index: scripts/find-lang.sh
|
||||
===================================================================
|
||||
--- scripts/find-lang.sh.orig
|
||||
+++ scripts/find-lang.sh
|
||||
@@ -28,10 +28,10 @@ the top of the tree containing the files
|
||||
PACKAGE_NAME is the %{name} of the package. This should also be
|
||||
the basename of the .mo files. the output is written to
|
||||
PACKAGE_NAME.lang unless \$3 is given in which case output is written
|
||||
-to \$3.
|
||||
+to \$3 (note, that \$3 is appended to if given).
|
||||
+to \$3 (note that \$3 is appended to if given).
|
||||
Additional options:
|
||||
- --with-gnome find GNOME help files
|
||||
- --with-kde find KDE help files
|
||||
+ --without-gnome find GNOME help files
|
||||
+ --without-kde find KDE help files
|
||||
+ --without-gnome do not find GNOME help files
|
||||
+ --without-kde do not find KDE help files
|
||||
--with-qt find Qt translation files
|
||||
--with-man find localized man pages
|
||||
--all-name match all package/domain names
|
||||
--without-mo not find locales files
|
||||
EOF
|
||||
@@ -52,8 +52,8 @@
|
||||
@@ -54,8 +54,8 @@ else NAME=$1
|
||||
fi
|
||||
shift
|
||||
|
||||
@@ -22,32 +24,28 @@
|
||||
-KDE=#
|
||||
+GNOME=
|
||||
+KDE=
|
||||
QT=#
|
||||
MAN=#
|
||||
MO=
|
||||
MO_NAME=$NAME.lang
|
||||
ALL_NAME=#
|
||||
@@ -61,12 +61,12 @@
|
||||
|
||||
while test $# -gt 0 ; do
|
||||
case "${1}" in
|
||||
- --with-gnome )
|
||||
- GNOME=
|
||||
@@ -73,6 +73,14 @@ while test $# -gt 0 ; do
|
||||
KDE=
|
||||
shift
|
||||
;;
|
||||
+ --without-gnome )
|
||||
+ GNOME=#
|
||||
shift
|
||||
;;
|
||||
- --with-kde )
|
||||
- KDE=
|
||||
+ shift
|
||||
+ ;;
|
||||
+ --without-kde )
|
||||
+ KDE=#
|
||||
+ shift
|
||||
+ ;;
|
||||
--with-qt )
|
||||
QT=
|
||||
shift
|
||||
;;
|
||||
--without-mo )
|
||||
@@ -85,26 +85,43 @@
|
||||
@@ -97,32 +105,48 @@ while test $# -gt 0 ; do
|
||||
esac
|
||||
done
|
||||
|
||||
-find $TOP_DIR -type f|sed '
|
||||
+
|
||||
+if ! test -s $MO_NAME ; then
|
||||
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
|
||||
+fi
|
||||
@@ -55,7 +53,7 @@
|
||||
+MO_NAME_NEW=$MO_NAME.tmp.$$
|
||||
+rm -f $MO_NAME_NEW
|
||||
+
|
||||
+find $TOP_DIR -type f -o -type l|sed '
|
||||
find $TOP_DIR -type f -o -type l|sed '
|
||||
s:'"$TOP_DIR"'::
|
||||
'"$ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*\.mo$\):%lang(\2) \1\2\3:
|
||||
'"$NO_ALL_NAME$MO"'s:\(.*/share/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
|
||||
@@ -89,11 +87,27 @@
|
||||
s:^\([^%].*\)::
|
||||
s:%lang(C) ::
|
||||
-/^$/d' >> $MO_NAME
|
||||
+/^ *$/d' >> $MO_NAME_NEW
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
find $TOP_DIR -type d|sed '
|
||||
s:'"$TOP_DIR"'::
|
||||
@@ -112,12 +129,20 @@
|
||||
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
|
||||
s:^\([^%].*\)::
|
||||
-/^$/d' >> $MO_NAME
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
find $TOP_DIR -type f|sed '
|
||||
s:'"$TOP_DIR"'::
|
||||
@@ -130,7 +154,7 @@ s:'"$TOP_DIR"'::
|
||||
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
|
||||
s:^[^%].*::
|
||||
s:%lang(C) ::
|
||||
-/^$/d' >> $MO_NAME
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
find $TOP_DIR -type d|sed '
|
||||
s:'"$TOP_DIR"'::
|
||||
@@ -138,9 +162,13 @@ s:'"$TOP_DIR"'::
|
||||
'"$NO_ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) \1\2\3:
|
||||
'"$ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
|
||||
'"$ALL_NAME$KDE"'s:\(.*/doc/kde/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
|
||||
@@ -104,15 +118,40 @@
|
||||
s:^\([^%].*\)::
|
||||
s:%lang(C) ::
|
||||
-/^$/d' >> $MO_NAME
|
||||
+/^ *$/d' >> $MO_NAME_NEW
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
find $TOP_DIR -type f -o -type l|sed '
|
||||
s:'"$TOP_DIR"'::
|
||||
@@ -148,7 +176,7 @@ s:'"$TOP_DIR"'::
|
||||
'"$ALL_NAME$QT"'s:\(.*[/_]\([^/_]\+\)\.qm$\):%lang(\2) \1:
|
||||
s:^[^%].*::
|
||||
s:%lang(C) ::
|
||||
-/^$/d' >> $MO_NAME
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
find $TOP_DIR -type d|sed '
|
||||
s:'"$TOP_DIR"'::
|
||||
@@ -156,17 +184,20 @@ s:'"$TOP_DIR"'::
|
||||
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1:
|
||||
s:^\([^%].*\)::
|
||||
s:%lang(C) ::
|
||||
-/^$/d' >> $MO_NAME
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
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:^\([^%].*\)::
|
||||
s:%lang(C) ::
|
||||
-/^$/d' >> $MO_NAME
|
||||
+/^$/d' >> $MO_NAME_NEW
|
||||
|
||||
-if ! grep -q / $MO_NAME; then
|
||||
+if ! grep -q / $MO_NAME_NEW ; then
|
||||
+if ! grep -q / $MO_NAME_NEW; then
|
||||
echo "No translations found for ${NAME} in ${TOP_DIR}"
|
||||
+ rm -f $MO_NAME_NEW
|
||||
+ rm -rf $MO_NAME_NEW
|
||||
exit 1
|
||||
+else
|
||||
+ sort -u $MO_NAME_NEW >> $MO_NAME
|
||||
+ rm -f $MO_NAME_NEW
|
||||
fi
|
||||
+sort -u $MO_NAME_NEW >> $MO_NAME
|
||||
+rm -f $MO_NAME_NEW
|
||||
exit 0
|
||||
|
Reference in New Issue
Block a user