Hello, Attached is a patch for find-lang.sh containing the following improvements:
- spelling fixes - POSIX compliance fix for find(1) usage - Qt translation support - localized man page support - match *.omf, not *omf Split patches available at http://scop.fedorapeople.org/patches/rpm/ if you prefer them that way or wish to cherry pick.
diff -r 7bcadd573028 scripts/find-lang.sh --- a/scripts/find-lang.sh Thu Oct 11 14:14:00 2007 +0300 +++ b/scripts/find-lang.sh Sat Oct 13 21:13:30 2007 +0300 @@ -11,7 +11,7 @@ #in tact and are included with any redistribution of this file or any #work based on this file. -# 2004-06-20 Arkadiusz Mi¶kiewicz <[EMAIL PROTECTED]> +# 2004-06-20 Arkadiusz MiÅkiewicz <[EMAIL PROTECTED]> # * merge PLD changes, kde, all-name (mkochano,[EMAIL PROTECTED]) # 1999-10-19 Artur Frysiak <[EMAIL PROTECTED]> # * added support for GNOME help files @@ -32,8 +32,10 @@ Additional options: Additional options: --with-gnome find GNOME help files --with-kde 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 + --without-mo do not find locale files EOF exit 1 } @@ -54,6 +56,8 @@ shift GNOME=# KDE=# +QT=# +MAN=# MO= MO_NAME=$NAME.lang ALL_NAME=# @@ -67,6 +71,14 @@ while test $# -gt 0 ; do ;; --with-kde ) KDE= + shift + ;; + --with-qt ) + QT= + shift + ;; + --with-man ) + MAN= shift ;; --without-mo ) @@ -85,7 +97,7 @@ while test $# -gt 0 ; do esac done -find $TOP_DIR -type f -or -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: @@ -114,8 +126,8 @@ s:^\([^%].*\):: find $TOP_DIR -type f|sed ' s:'"$TOP_DIR"':: -'"$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: +'"$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: s:^[^%].*:: s:%lang(C) :: /^$/d' >> $MO_NAME @@ -130,6 +142,29 @@ s:%lang(C) :: s:%lang(C) :: /^$/d' >> $MO_NAME +find $TOP_DIR -type f -o -type l|sed ' +s:'"$TOP_DIR"':: +'"$NO_ALL_NAME$QT"'s:\(.*/'"$NAME"'_\([^/.]\+\)\.qm$\):%lang(\2) \1: +'"$ALL_NAME$QT"'s:\(.*[/_]\([^/_]\+\)\.qm$\):%lang(\2) \1: +s:^[^%].*:: +s:%lang(C) :: +/^$/d' >> $MO_NAME + +find $TOP_DIR -type d|sed ' +s:'"$TOP_DIR"':: +'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+/\):: +'"$ALL_NAME$MAN"'s:\(.*/man/\([^/_]\+\).*/man[a-z0-9]\+$\):%lang(\2) \1: +s:^\([^%].*\):: +s:%lang(C) :: +/^$/d' >> $MO_NAME + +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 + if ! grep -q / $MO_NAME; then echo "No translations found for ${NAME} in ${TOP_DIR}" exit 1
_______________________________________________ Rpm-maint mailing list Rpm-maint@lists.rpm.org https://lists.rpm.org/mailman/listinfo/rpm-maint