From: Elan Ruusamäe Date: Fri, 15 Feb 2008 00:07:53 +0000 (+0000) Subject: - add -o (output) and -a (append) options X-Git-Tag: auto/ac/rpm-build-macros-1_433-2~2 X-Git-Url: http://git.pld-linux.org/?p=packages%2Frpm-build-macros.git;a=commitdiff_plain;h=4b717e5d4fc029d10f207e4307e2b554ff64c131 - add -o (output) and -a (append) options Changed files: rpm-find-lang -> 1.31 --- 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 | \