2019-10-02 15:28:11 +02:00
|
|
|
--- ./scripts/find-lang.sh.orig 2019-09-09 07:56:53.377788842 +0000
|
|
|
|
+++ ./scripts/find-lang.sh 2019-10-02 11:12:53.774861485 +0000
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -22,11 +22,11 @@ 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
|
2008-09-12 20:37:28 +02:00
|
|
|
+ --without-gnome do not find GNOME help files
|
2017-01-19 16:41:55 +01:00
|
|
|
--with-mate find MATE help files
|
|
|
|
- --with-kde find KDE help files
|
2008-09-12 20:37:28 +02:00
|
|
|
+ --without-kde do not find KDE help files
|
|
|
|
--with-qt find Qt translation files
|
2017-01-19 16:41:55 +01:00
|
|
|
--with-html find HTML files
|
2008-09-12 20:37:28 +02:00
|
|
|
--with-man find localized man pages
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -50,9 +50,9 @@ else NAMES[0]=$1
|
2006-12-19 00:17:44 +01:00
|
|
|
fi
|
|
|
|
shift
|
|
|
|
|
|
|
|
-GNOME=#
|
|
|
|
+GNOME=
|
2017-01-19 16:41:55 +01:00
|
|
|
MATE=#
|
|
|
|
-KDE=#
|
2006-12-19 00:17:44 +01:00
|
|
|
+KDE=
|
2008-09-12 20:37:28 +02:00
|
|
|
QT=#
|
|
|
|
MAN=#
|
2017-01-19 16:41:55 +01:00
|
|
|
HTML=#
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -74,6 +74,14 @@ while test $# -gt 0 ; do
|
2008-09-12 20:37:28 +02:00
|
|
|
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
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -103,11 +111,13 @@ while test $# -gt 0 ; do
|
|
|
|
shift
|
|
|
|
;;
|
2006-12-19 00:17:44 +01:00
|
|
|
esac
|
2018-01-31 15:06:28 +01:00
|
|
|
-done
|
|
|
|
+done
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2018-01-31 15:06:28 +01:00
|
|
|
-if [ -f $MO_NAME ]; then
|
|
|
|
- rm $MO_NAME
|
2006-12-19 00:17:44 +01:00
|
|
|
+if ! test -s $MO_NAME ; then
|
2011-05-16 18:07:44 +02:00
|
|
|
+ echo "%defattr (644, root, root, 755)" > $MO_NAME
|
2018-01-31 15:06:28 +01:00
|
|
|
fi
|
2006-12-19 00:17:44 +01:00
|
|
|
+MO_NAME_NEW=$MO_NAME.tmp.$$
|
|
|
|
+rm -f $MO_NAME_NEW
|
2018-01-31 15:06:28 +01:00
|
|
|
|
|
|
|
for NAME in ${NAMES[@]}; do
|
|
|
|
|
|
|
|
@@ -117,7 +127,7 @@ s:'"$TOP_DIR"'::
|
2011-09-16 14:38:52 +02:00
|
|
|
'"$NO_ALL_NAME$MO"'s:\(.*/locale/\)\([^/_]\+\)\(.*/'"$NAME"'\.mo$\):%lang(\2) \1\2\3:
|
2006-12-19 00:17:44 +01:00
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
2018-01-31 15:06:28 +01:00
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
2012-08-28 15:31:44 +02:00
|
|
|
|
|
|
|
find "$TOP_DIR" -type d|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -125,27 +135,27 @@ s:'"$TOP_DIR"'::
|
2012-08-28 15:31:44 +02:00
|
|
|
'"$ALL_NAME$GNOME"'s:\(.*/share/help/\)\([^/_]\+\)\([^/]*\)\(/[a-zA-Z0-9.\_\-]\+\)$:%lang(\2) %doc \1\2\3\4/:
|
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
2009-08-28 15:54:03 +02:00
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
find "$TOP_DIR" -type d|sed '
|
2006-12-19 00:17:44 +01:00
|
|
|
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
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
find "$TOP_DIR" -type d|sed '
|
2008-09-12 20:37:28 +02:00
|
|
|
s:'"$TOP_DIR"'::
|
|
|
|
'"$NO_ALL_NAME$GNOME"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
|
2009-08-28 15:54:03 +02:00
|
|
|
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
|
2008-09-12 20:37:28 +02:00
|
|
|
s:^\([^%].*\)::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
find "$TOP_DIR" -type f|sed '
|
2008-09-12 20:37:28 +02:00
|
|
|
s:'"$TOP_DIR"'::
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -153,7 +163,7 @@ s:'"$TOP_DIR"'::
|
2008-09-12 20:37:28 +02:00
|
|
|
'"$ALL_NAME$GNOME"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
|
|
|
|
s:^[^%].*::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
2017-01-19 16:41:55 +01:00
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
|
|
|
find $TOP_DIR -type d|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -166,14 +176,14 @@ s:'"$TOP_DIR"'::
|
2017-01-19 16:41:55 +01:00
|
|
|
s:%lang(.*) .*/mate/help/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+/.*::
|
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
|
|
|
find "$TOP_DIR" -type d|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
2017-12-05 11:46:24 +01:00
|
|
|
'"$NO_ALL_NAME$MATE"'s:\(.*/omf/'"$NAME"'$\):%dir \1:
|
|
|
|
'"$ALL_NAME$MATE"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
|
|
|
|
s:^\([^%].*\)::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
|
|
|
find "$TOP_DIR" -type f|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -181,7 +191,7 @@ s:'"$TOP_DIR"'::
|
2017-01-19 16:41:55 +01:00
|
|
|
'"$ALL_NAME$MATE"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+/[a-zA-Z0-9.\_\-]\+-\([^/.]\+\)\.omf\):%lang(\2) \1:
|
|
|
|
s:^[^%].*::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
2008-09-12 20:37:28 +02:00
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2009-08-28 15:54:03 +02:00
|
|
|
KDE3_HTML=`kde-config --expandvars --install html 2>/dev/null`
|
2019-10-02 15:28:11 +02:00
|
|
|
if [ x"$KDE3_HTML" != x ] && [ -d "$TOP_DIR$KDE3_HTML" ]; then
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -193,7 +203,7 @@ s:'"$TOP_DIR"'::
|
2009-08-28 15:54:03 +02:00
|
|
|
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
|
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
fi
|
|
|
|
|
|
|
|
KDE4_HTML=`kde4-config --expandvars --install html 2>/dev/null`
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -206,7 +216,7 @@ s:'"$TOP_DIR"'::
|
2009-08-28 15:54:03 +02:00
|
|
|
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
|
2006-12-19 00:17:44 +01:00
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
2008-09-12 20:37:28 +02:00
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
2009-08-28 15:54:03 +02:00
|
|
|
fi
|
2008-09-12 20:37:28 +02:00
|
|
|
|
2017-12-05 11:46:24 +01:00
|
|
|
KF5_HTML=`kf5-config --expandvars --install html 2>/dev/null`
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -219,7 +229,7 @@ s:'"$TOP_DIR"'::
|
2017-12-05 11:46:24 +01:00
|
|
|
'"$ALL_NAME$KDE"'s:\(.*/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
|
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
fi
|
|
|
|
|
2017-01-19 16:41:55 +01:00
|
|
|
find "$TOP_DIR" -type d|sed '
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -230,7 +240,7 @@ s:'"$TOP_DIR"'::
|
2017-01-19 16:41:55 +01:00
|
|
|
'"$ALL_NAME$HTML"'s:\(.*/doc/HTML/\)\([^/_]\+\)\(.*/[a-zA-Z0-9.\_\-]\+$\):%lang(\2) \1\2\3:
|
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
find "$TOP_DIR" -type f -o -type l|sed '
|
2017-01-19 16:41:55 +01:00
|
|
|
s:'"$TOP_DIR"'::
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -243,7 +253,7 @@ s:'"$TOP_DIR"'::
|
2009-08-28 15:54:03 +02:00
|
|
|
'"$ALL_NAME$QT"'s:^\([^%].*/[^/]\+_\([a-zA-Z]\{2\}\)\.qm$\):%lang(\2) \1:
|
2008-09-12 20:37:28 +02:00
|
|
|
s:^[^%].*::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
2012-08-28 15:31:44 +02:00
|
|
|
find "$TOP_DIR" -type d|sed '
|
2008-09-12 20:37:28 +02:00
|
|
|
s:'"$TOP_DIR"'::
|
2018-01-31 15:06:28 +01:00
|
|
|
@@ -251,19 +261,24 @@ s:'"$TOP_DIR"'::
|
2009-08-28 15:54:03 +02:00
|
|
|
'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1*:
|
2008-09-12 20:37:28 +02:00
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
|
2017-01-19 16:41:55 +01:00
|
|
|
find "$TOP_DIR" -type f -o -type l|sed -r 's/\.(bz2|gz|xz|lzma|Z)$//g' | sed '
|
2008-09-12 20:37:28 +02:00
|
|
|
s:'"$TOP_DIR"'::
|
2009-08-28 15:54:03 +02:00
|
|
|
'"$NO_ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/'"$NAME"'\.[a-z0-9].*\):%lang(\2) \1*:
|
2008-09-12 20:37:28 +02:00
|
|
|
s:^\([^%].*\)::
|
|
|
|
s:%lang(C) ::
|
|
|
|
-/^$/d' >> $MO_NAME
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
2006-12-19 00:17:44 +01:00
|
|
|
|
2018-01-31 15:06:28 +01:00
|
|
|
done # for NAME in ${NAMES[@]}
|
|
|
|
|
2006-12-19 00:17:44 +01:00
|
|
|
-if ! grep -q / $MO_NAME; then
|
2018-01-31 15:06:28 +01:00
|
|
|
- echo "No translations found for ${NAME} in ${TOP_DIR}"
|
2008-09-12 20:37:28 +02:00
|
|
|
+if ! grep -q / $MO_NAME_NEW; then
|
2018-01-31 15:06:28 +01:00
|
|
|
+ echo "No translations found for ${NAMES[*]} in ${TOP_DIR}"
|
2009-08-28 15:54:03 +02:00
|
|
|
+ rm -f $MO_NAME_NEW
|
2006-12-19 00:17:44 +01:00
|
|
|
exit 1
|
|
|
|
fi
|
2009-08-28 15:54:03 +02:00
|
|
|
+
|
2008-09-12 20:37:28 +02:00
|
|
|
+sort -u $MO_NAME_NEW >> $MO_NAME
|
|
|
|
+rm -f $MO_NAME_NEW
|
2009-08-28 15:54:03 +02:00
|
|
|
+
|
2006-12-19 00:17:44 +01:00
|
|
|
exit 0
|