From ac661a8436f9d63277e610f12b854fa257caea44 Mon Sep 17 00:00:00 2001 From: jbj Date: Mon, 5 Oct 1998 17:25:18 +0000 Subject: [PATCH] remove 2 character language name assumption. add /usr/lib/rpm/find-lang.sh (W. L. Estes ) CVS patchset: 2391 CVS date: 1998/10/05 17:25:18 --- scripts/find-lang.sh | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100755 scripts/find-lang.sh diff --git a/scripts/find-lang.sh b/scripts/find-lang.sh new file mode 100755 index 0000000..139617a --- /dev/null +++ b/scripts/find-lang.sh @@ -0,0 +1,50 @@ +#!/bin/bash +#findlang - automagically generate list of language specific files +#for inclusion in an rpm spec file. +#This does assume that the *.mo files are under .../share/locale/... +#Run with no arguments gets a usage message. + +#findlang is copyright (c) 1998 by W. L. Estes + +#Redistribution and use of this software are hereby permitted for any +#purpose as long as this notice and the above copyright notice remain +#in tact and are included with any redistribution of this file or any +#work based on this file. + +usage () { +cat <&2 +elif [ ! -d $1 ] ; then +echo $0: $1: no such directory +exit 1 +else TOP_DIR=$1 +fi + +if [ -z "$2" ] ; then usage +else NAME=$2 +fi + +MO_NAME=${3:-$NAME.lang} + +find $TOP_DIR -name $NAME.mo|sed ' +1i\ +%defattr (644, root, root, 755) +s:'"$TOP_DIR"':: +s:\(.*/share/locale/\)\([^/_]\+\):%lang(\2) \1\2: +' > $MO_NAME -- 2.7.4