# * start support for KDE help files
PROG=${0##*/}
+VERSION=$(set -- $Revision$; echo $2)
usage () {
cat <<EOF
-
Usage: $PROG TOP_DIR PACKAGE_NAME [prefix]
where TOP_DIR is
--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
}
KDE='#'
OMF='#'
MO=''
-MO_NAME=$NAME.lang
+OUTPUT=$NAME.lang
ALL_NAME='#'
NO_ALL_NAME=''
+APPEND=''
while test $# -gt 0 ; do
case "$1" in
--with-gnome)
NO_ALL_NAME='#'
shift
;;
- * )
- MO_NAME=$1
+ -o)
+ shift
+ OUTPUT=$1
+ shift
+ ;;
+ -a)
+ shift
+ OUTPUT=$1
+ APPEND='>'
+ shift
+ ;;
+ *)
+ OUTPUT=$1
shift
;;
esac
-done
+done
+
+echo "$PROG/$VERSION: find-lang '$NAME' $APPEND> $OUTPUT"
+MO_NAME=.$OUTPUT.tmp~
echo '%defattr(644,root,root,755)' > $MO_NAME
if [ ! -f __find.files ] || [ "$TOP_DIR" -nt __find.files ]; then
s:%lang(C) ::' >> $MO_NAME
if [ "$(egrep -v '(^%defattr|^$)' $MO_NAME | wc -l)" -le 0 ]; then
- echo >&2 "Error: international files not found for $NAME!"
+ echo >&2 "$PROG: Error: international files not found for '$NAME'!"
exit 1
fi
+
+if [ "$APPEND" ]; then
+ cat $MO_NAME >> $OUTPUT
+ rm -f $MO_NAME
+else
+ mv -f $MO_NAME $OUTPUT
+fi