[Libreoffice-commits] .: bin/lo-unify-sdf

Petr Mladek pmladek at kemper.freedesktop.org
Wed Nov 10 03:42:20 PST 2010


 bin/lo-unify-sdf |   45 +++++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 45 insertions(+)

New commits:
commit d3b465e9fa51e7e0ab324f84a414da9dcaa3d246
Author: Petr Mladek <pmladek at suse.cz>
Date:   Wed Nov 10 12:40:29 2010 +0100

    helper script to unify sdf files
    
    helps to reduce differences when updating the l10n repository

diff --git a/bin/lo-unify-sdf b/bin/lo-unify-sdf
new file mode 100755
index 0000000..a4bc5af
--- /dev/null
+++ b/bin/lo-unify-sdf
@@ -0,0 +1,45 @@
+#!/bin/sh
+
+usage()
+{
+    echo "This script unifies the sdf files to be commited into l10n git repo"
+    echo
+    echo "Usage: ${0##*/} in [out]"
+    echo
+    echo "Options:"
+    echo
+    echo "	in      input file"
+    echo "	out     output file"
+}
+
+in="$1"
+out="$2"
+tempdir=
+
+if test -z "$in" ; then
+    echo "Error: Please, define input file"
+    exit 1;
+fi
+
+if test ! -f "$in" ; then
+    echo "Error: input file does not exist: $in"
+    exit 1;
+fi
+
+if test -z "$out" ; then
+    tempdir=`mktemp -D -t lo-unify-sdf-XXXXXX`
+    out="$tempdir/out.sdf"
+fi
+
+echo "Cleaning $in..."
+grep -v "^[^	]*	[^	]*	[^	]*	[^	]*	[^	]*	[^	]*	[^	]*	[^	]*	[^	]*	en-US" "$in" | \
+LANG=C sort >$out
+
+dos2unix $out
+
+# no input file define, so overwrite the original file
+if test -n "$temp_out" ; then
+    chmod --reference="$in" "$out"
+    mv "$out" "$in"
+    rm -rf "$tempdir"
+fi


More information about the Libreoffice-commits mailing list