2008-09-12 20:37:28 +02:00
|
|
|
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
|
2006-12-19 00:17:44 +01:00
|
|
|
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.
|
2008-09-12 20:37:28 +02:00
|
|
|
+to \$3 (note that \$3 is appended to if given).
|
2006-12-19 00:17:44 +01:00
|
|
|
Additional options:
|
|
|
|
- --with-gnome find GNOME help files
|
|
|
|
- --with-kde find KDE help files
|
2008-09-12 20:37:28 +02:00
|
|
|
+ --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
|
2006-12-19 00:17:44 +01:00
|
|
|
--all-name match all package/domain names
|
2008-09-12 20:37:28 +02:00
|
|
|
@@ -54,8 +54,8 @@ else NAME=$1
|
2006-12-19 00:17:44 +01:00
|
|
|
fi
|
|
|
|
shift
|
|
|
|
|
|
|
|
-GNOME=#
|
|
|
|
-KDE=#
|
|
|
|
+GNOME=
|
|
|
|
+KDE=
|
2008-09-12 20:37:28 +02:00
|
|
|
QT=#
|
|
|
|
MAN=#
|
2006-12-19 00:17:44 +01:00
|
|
|
MO=
|
2008-09-12 20:37:28 +02:00
|
|
|
@@ -73,6 +73,14 @@ while test $# -gt 0 ; do
|
|
|
|
KDE=
|
2006-12-19 00:17:44 +01:00
|
|
|
shift
|
|
|
|
;;
|
2008-09-12 20:37:28 +02:00
|
|
|
+ --without-gnome )
|
|
|
|
+ GNOME=#
|
|
|
|
+ shift
|
|
|
|
+ ;;
|
2006-12-19 00:17:44 +01:00
|
|
|
+ --without-kde )
|
|
|
|
+ KDE=#
|
2008-09-12 20:37:28 +02:00
|
|
|
+ shift
|
|
|
|
+ ;;
|
|
|
|
--with-qt )
|
|
|
|
QT=
|
2006-12-19 00:17:44 +01:00
|
|
|
shift
|
2008-09-12 20:37:28 +02:00
|
|
|
@@ -97,32 +105,48 @@ while test $# -gt 0 ; do
|
2006-12-19 00:17:44 +01:00
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
|
|
|
+if ! test -s $MO_NAME ; then
|
2006-12-19 00:17:44 +01:00
|
|
|
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
|
2006-12-19 00:17:44 +01:00
|
|
|
+fi
|
|
|
|
+
|
|
|
|
+MO_NAME_NEW=$MO_NAME.tmp.$$
|
|
|
|
+rm -f $MO_NAME_NEW
|
|
|
|
+
|
2008-09-12 20:37:28 +02:00
|
|
|
find $TOP_DIR -type f -o -type l|sed '
|
2006-12-19 00:17:44 +01:00
|
|
|
s:'"$TOP_DIR"'::
|
2006-12-19 00:17:44 +01:00
|
|
|
'"$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:
|
2006-12-19 00:17:44 +01:00
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' > $MO_NAME
|
2006-12-19 00:17:44 +01:00
|
|
|
+/^ *$/d' >> $MO_NAME_NEW
|
|
|
|
+
|
|
|
|
+find $TOP_DIR -type f -o -type l|sed '
|
|
|
|
+s:'"$TOP_DIR"'::
|
|
|
|
+/\/share\/locale\//d
|
|
|
|
+'"$ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\([^/]*\)\(.*\)/LC_MESSAGES/.*\.mo$:%lang(\2) %doc \1\2\3\4:
|
|
|
|
+'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\([^/]*\)\(.*\)/LC_MESSAGES/'"$NAME"'\.mo$:%lang(\2) %doc \1\2\3\4:
|
|
|
|
+s:^\([^%].*\)::
|
|
|
|
+s:%lang(C) ::
|
|
|
|
+/^ *$/d' >> $MO_NAME_NEW
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
find $TOP_DIR -type d|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
|
|
|
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir \1:
|
|
|
|
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'$\):%dir %doc \1:
|
|
|
|
'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'/[a-zA-Z0-9.\_\-]/.\+\)::
|
2008-03-27 18:08:51 +01:00
|
|
|
-'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) \1\2:
|
2006-12-19 00:17:44 +01:00
|
|
|
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
|
2008-03-27 18:08:51 +01:00
|
|
|
+'"$NO_ALL_NAME$GNOME"'s:\(.*/gnome/help/'"$NAME"'\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
|
2006-12-19 00:17:44 +01:00
|
|
|
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+$\):%dir %doc \1:
|
|
|
|
'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]/.\+\)::
|
|
|
|
-'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) \1\2:
|
|
|
|
+'"$ALL_NAME$GNOME"'s:\(.*/gnome/help/[a-zA-Z0-9.\_\-]\+\/\)\([^/_]\+\):%lang(\2) %doc \1\2:
|
|
|
|
s:%lang(.*) .*/gnome/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
|
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
2008-09-12 20:37:28 +02:00
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
|
|
|
find $TOP_DIR -type d|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
|
|
|
'"$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
|
2008-09-12 20:37:28 +02:00
|
|
|
|
|
|
|
find $TOP_DIR -type d|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
2008-09-12 20:37:28 +02:00
|
|
|
@@ -138,9 +162,13 @@ s:'"$TOP_DIR"'::
|
2006-12-19 00:17:44 +01:00
|
|
|
'"$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:
|
|
|
|
+'"$NO_ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'/\)::
|
2007-05-17 00:32:19 +02:00
|
|
|
+'"$NO_ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/'"$NAME"'\)$:%lang(\2) %doc \1\2\3:
|
2006-12-19 00:17:44 +01:00
|
|
|
+'"$ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+/\)::
|
2007-05-17 00:32:19 +02:00
|
|
|
+'"$ALL_NAME$KDE"'s:\(.*/kde.*share/doc/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) %doc \1\2\3:
|
2009-08-28 15:54:03 +02:00
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
2008-09-12 20:37:28 +02:00
|
|
|
+/^$/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
|
2006-12-19 00:17:44 +01:00
|
|
|
|
|
|
|
-if ! grep -q / $MO_NAME; then
|
2008-09-12 20:37:28 +02:00
|
|
|
+if ! grep -q / $MO_NAME_NEW; then
|
2006-12-19 00:17:44 +01:00
|
|
|
echo "No translations found for ${NAME} in ${TOP_DIR}"
|
2008-09-12 20:37:28 +02:00
|
|
|
+ rm -rf $MO_NAME_NEW
|
2006-12-19 00:17:44 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
2008-09-12 20:37:28 +02:00
|
|
|
+sort -u $MO_NAME_NEW >> $MO_NAME
|
|
|
|
+rm -f $MO_NAME_NEW
|
2006-12-19 00:17:44 +01:00
|
|
|
exit 0
|