From: Marcin Banasiak Date: Mon, 24 Sep 2007 16:24:50 +0000 (+0000) Subject: - added support for OMF files X-Git-Tag: rpm-4_4_9-9~1 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm.git;a=commitdiff_plain;h=1564aea1b967d0cdebe2bf8f8974bff9eb6e3622 - added support for OMF files Changed files: rpm-find-lang -> 1.22 --- diff --git a/rpm-find-lang b/rpm-find-lang index 9780aa4..fbbafbb 100644 --- a/rpm-find-lang +++ b/rpm-find-lang @@ -49,6 +49,7 @@ to \$3. Additional options: --with-gnome find GNOME help files --with-kde find KDE help files + --with-omf find OMF files --all-name match all package/domain names --without-mo skip *.mo locale files EOF @@ -77,6 +78,7 @@ shift GNOME='#' KDE='#' +OMF='#' MO='' MO_NAME=$NAME.lang ALL_NAME='#' @@ -93,6 +95,11 @@ while test $# -gt 0 ; do KDE='' shift ;; + --with-omf) + echo "$PROG: Enabling with OMF" + OMF='' + shift + ;; --without-mo) echo "$PROG: Disabling .mo files" MO='#' @@ -122,6 +129,15 @@ else echo "$PROG: Using cached __find.files" fi +if [ ! -f __omf.files ] || [ "$TOP_DIR" -nt __omf.files ]; then + find $TOP_DIR -type f -name '*.omf' | \ + sed -e ' + s/:.*// + s:'"$TOP_DIR"'::' > __omf.files +else + echo "$PROG: Using cached __omf.files" +fi + ( if [ "$ALL_NAME" ]; then fgrep $NAME __find.files @@ -135,6 +151,19 @@ s:^\([^%].*\):: s:%lang(C) :: s:^\$::' | egrep -v '^$' >> $MO_NAME +( + if [ "$ALL_NAME" ]; then + fgrep $NAME __omf.files + else + cat __omf.files + fi +) | sed ' +'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4: +'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'\)\(.*\-\)\(.*\)\(.*\.omf\):%lang(\3) \1\2\3\4: +s:^\([^%].*\):: +s:%lang(C) :: +s:^\$::' | egrep -v '^$' >> $MO_NAME + if [ ! -f __find.dirs ] || [ "$TOP_DIR" -nt __find.dirs ]; then find $TOP_DIR -type d | sed 's:'"$TOP_DIR"'::' > __find.dirs else @@ -172,6 +201,18 @@ s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME s:^\([^%].*\):: s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME +( + if [ "$ALL_NAME" ]; then + fgrep $NAME __find.dirs + else + cat __find.dirs + fi +) | sed ' +'"$NO_ALL_NAME$OMF"'s:\(.*/omf/'"$NAME"'$\):%dir \1: +'"$ALL_NAME$OMF"'s:\(.*/omf/[a-zA-Z0-9.\_\-]\+$\):%dir \1: +s:^\([^%].*\):: +s:%lang(C) ::' | egrep -v '^$' >> $MO_NAME + if [ "$(egrep -v '(^%defattr|^$)' $MO_NAME | wc -l)" -le 0 ]; then echo >&2 "Error: international files not found for $NAME!" exit 1