From 4b717e5d4fc029d10f207e4307e2b554ff64c131 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Elan=20Ruusam=C3=A4e?= Date: Fri, 15 Feb 2008 00:07:53 +0000 Subject: [PATCH] - add -o (output) and -a (append) options Changed files: rpm-find-lang -> 1.31 --- rpm-find-lang | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/rpm-find-lang b/rpm-find-lang index bf84b34..bfc5a35 100644 --- a/rpm-find-lang +++ b/rpm-find-lang @@ -54,6 +54,8 @@ Additional options: --with-omf find OMF files --all-name match all package/domain names --without-mo skip *.mo locale files + -o NAME output will be saved to NAME + -a NAME output will be appended to NAME EOF exit 1 } @@ -78,8 +80,6 @@ else fi shift -echo "$PROG $VERSION: find-lang for '$NAME'" - GNOME='#' KDE='#' OMF='#' @@ -87,6 +87,7 @@ MO='' MO_NAME=$NAME.lang ALL_NAME='#' NO_ALL_NAME='' +APPEND='' while test $# -gt 0 ; do case "$1" in --with-gnome) @@ -115,14 +116,27 @@ while test $# -gt 0 ; do NO_ALL_NAME='#' shift ;; - * ) + -o) + shift + MO_NAME=$1 + shift + ;; + -a) + shift + MO_NAME=$1 + APPEND='>' + shift + ;; + *) MO_NAME=$1 shift ;; esac -done +done + +echo "$PROG/$VERSION: find-lang '$NAME' $APPEND> $MO_NAME" -echo '%defattr(644,root,root,755)' > $MO_NAME +[ -z "$APPEND" ] && echo '%defattr(644,root,root,755)' > $MO_NAME if [ ! -f __find.files ] || [ "$TOP_DIR" -nt __find.files ]; then find $TOP_DIR -xtype f -name '*.mo' | xargs -r file -L | \ -- 2.44.0