From 1564aea1b967d0cdebe2bf8f8974bff9eb6e3622 Mon Sep 17 00:00:00 2001 From: Marcin Banasiak Date: Mon, 24 Sep 2007 16:24:50 +0000 Subject: [PATCH] - added support for OMF files Changed files: rpm-find-lang -> 1.22 --- rpm-find-lang | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) 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 -- 2.43.0