2013-11-20 12:31:44 +01:00
|
|
|
Support for finding Python translation files in %python_sitelib
|
|
|
|
or %python_sitearch.
|
|
|
|
|
|
|
|
Sascha Peilicke <speilicke@suse.com>
|
2017-01-19 16:41:55 +01:00
|
|
|
--- ./scripts/find-lang.sh.orig 2017-01-19 13:07:41.062796290 +0000
|
|
|
|
+++ ./scripts/find-lang.sh 2017-01-19 13:07:48.561774470 +0000
|
|
|
|
@@ -35,6 +35,7 @@ Additional options:
|
2013-11-20 12:31:44 +01:00
|
|
|
--without-gnome do not find GNOME help files
|
2017-01-19 16:41:55 +01:00
|
|
|
--with-mate find MATE help files
|
2013-11-20 12:31:44 +01:00
|
|
|
--without-kde do not find KDE help files
|
|
|
|
+ --with-python find Python translation files
|
|
|
|
--with-qt find Qt translation files
|
2017-01-19 16:41:55 +01:00
|
|
|
--with-html find HTML files
|
2013-11-20 12:31:44 +01:00
|
|
|
--with-man find localized man pages
|
2017-01-19 16:41:55 +01:00
|
|
|
@@ -61,6 +62,7 @@ shift
|
2013-11-20 12:31:44 +01:00
|
|
|
GNOME=
|
2017-01-19 16:41:55 +01:00
|
|
|
MATE=#
|
2013-11-20 12:31:44 +01:00
|
|
|
KDE=
|
|
|
|
+PYTHON=#
|
|
|
|
QT=#
|
|
|
|
MAN=#
|
2017-01-19 16:41:55 +01:00
|
|
|
HTML=#
|
|
|
|
@@ -93,6 +95,10 @@ while test $# -gt 0 ; do
|
2013-11-20 12:31:44 +01:00
|
|
|
KDE=#
|
|
|
|
shift
|
|
|
|
;;
|
|
|
|
+ --with-python )
|
|
|
|
+ PYTHON=
|
|
|
|
+ shift
|
|
|
|
+ ;;
|
|
|
|
--with-qt )
|
|
|
|
QT=
|
|
|
|
shift
|
2017-01-19 16:41:55 +01:00
|
|
|
@@ -136,21 +142,25 @@ MO_NAME_NEW=$MO_NAME.tmp.$$
|
2013-11-20 12:31:44 +01:00
|
|
|
rm -f $MO_NAME_NEW
|
|
|
|
|
|
|
|
# remove languages we do not yet support - but give out statistics
|
|
|
|
-find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
|
|
|
|
- if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then
|
|
|
|
- find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
|
|
|
|
- echo -n "removing translation $file: "
|
|
|
|
- msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null -
|
|
|
|
+if [ -d "$TOP_DIR/usr/share/locale/" ] ; then
|
|
|
|
+ find "$TOP_DIR/usr/share/locale/" -maxdepth 1 -type d | sed 's:'"$TOP_DIR"/usr/share/locale/'::; /^$/d' | while read dir; do
|
|
|
|
+ if ! rpm -ql filesystem | egrep -q "/usr/share/locale/$dir"$; then
|
|
|
|
+ find $TOP_DIR/usr/share/locale/$dir -name *.mo | sed 's:'"$TOP_DIR"'::' | while read file; do
|
|
|
|
+ echo -n "removing translation $file: "
|
|
|
|
+ msgunfmt "$TOP_DIR/$file" | msgfmt --statistics -o /dev/null -
|
|
|
|
+ done
|
|
|
|
+ rm -rf $TOP_DIR/usr/share/locale/$dir
|
|
|
|
+ fi
|
|
|
|
done
|
|
|
|
- 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 "removing help translation /usr/share/help/$dir"
|
|
|
|
- rm -rf $TOP_DIR/usr/share/help/$dir
|
|
|
|
- fi
|
|
|
|
-done
|
|
|
|
+fi
|
|
|
|
+if [ -d "$TOP_DIR/usr/share/help/" ] ; then
|
|
|
|
+ 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 "removing help translation /usr/share/help/$dir"
|
|
|
|
+ rm -rf $TOP_DIR/usr/share/help/$dir
|
|
|
|
+ fi
|
|
|
|
+ done
|
|
|
|
+fi
|
|
|
|
|
|
|
|
find "$TOP_DIR" -type f -o -type l|sed '
|
|
|
|
s:'"$TOP_DIR"'::
|
2017-01-19 16:41:55 +01:00
|
|
|
@@ -201,6 +211,16 @@ s:'"$TOP_DIR"'::
|
2013-11-20 12:31:44 +01:00
|
|
|
s:^[^%].*::
|
|
|
|
'"$ONLY_C"'/%lang(C)/!d
|
|
|
|
'"$NO_C"'/%lang(C)/d
|
|
|
|
+s:%lang(C) ::
|
|
|
|
+/^$/d' >> $MO_NAME_NEW
|
|
|
|
+
|
|
|
|
+find "$TOP_DIR" -type f -o -type l|sed '
|
|
|
|
+s:'"$TOP_DIR"'::
|
|
|
|
+'"$NO_ALL_NAME$PYTHON"'s:\(/usr/lib.*/python.*/site-packages/'"$NAME"'$\):%dir \1:
|
|
|
|
+'"$ALL_NAME$PYTHON"'s:\(/usr/lib.*/python.*/site-packages/[a-zA-Z0-9.\_\-]\+$\):%dir \1:
|
|
|
|
+s:^[^%].*::
|
|
|
|
+'"$ONLY_C"'/%lang(C)/!d
|
|
|
|
+'"$NO_C"'/%lang(C)/d
|
|
|
|
s:%lang(C) ::
|
|
|
|
/^$/d' >> $MO_NAME_NEW
|
|
|
|
|