summaryrefslogtreecommitdiffstats
path: root/abs/extra/gconf/gconf-merge-schema
diff options
context:
space:
mode:
authorCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
committerCecil Hugh Watson <knoppmyth@gmail.com>2009-09-26 01:57:08 (GMT)
commit7b29169fff9e7c624890c5edffe85def8a293136 (patch)
tree47753889faa3a2063b66d1c7e7681e703eb1b39a /abs/extra/gconf/gconf-merge-schema
parentc491dea779dac29afff3578bf8245943817c2339 (diff)
downloadlinhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.zip
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.gz
linhes_pkgbuild-7b29169fff9e7c624890c5edffe85def8a293136.tar.bz2
LinHES 6.01.00
Diffstat (limited to 'abs/extra/gconf/gconf-merge-schema')
-rwxr-xr-xabs/extra/gconf/gconf-merge-schema34
1 files changed, 34 insertions, 0 deletions
diff --git a/abs/extra/gconf/gconf-merge-schema b/abs/extra/gconf/gconf-merge-schema
new file mode 100755
index 0000000..992c162
--- /dev/null
+++ b/abs/extra/gconf/gconf-merge-schema
@@ -0,0 +1,34 @@
+#!/bin/bash
+if [ ! "$1" -a ! "$2" ]; then
+ echo "Usage: $0 output.schemas [--domain gettextdomain] file1.schemas [file2.schemas [...]]"
+ exit 1
+fi
+
+OUTFILE="$1"
+DOMAIN=""
+shift
+
+if [ "$1" = "--domain" ]; then
+ shift
+ DOMAIN=$1
+ shift
+fi
+
+echo '<?xml version="1.0"?>' > "$OUTFILE"
+echo '<gconfschemafile><schemalist>' >> "$OUTFILE"
+
+while [ "$1" ]; do
+ if [ -f "$1" ]; then
+ sed -e '/<?xml/d' \
+ -e 's|<gconfschemafile>||g' \
+ -e 's|</gconfschemafile>||g' \
+ -e 's|<schemalist>||g' \
+ -e 's|</schemalist>||g' "$1" >> "$OUTFILE"
+ fi
+ shift
+done
+
+echo '</schemalist></gconfschemafile>' >> "$OUTFILE"
+if [ "$DOMAIN" != "" ]; then
+ sed -ri "s/^([[:space:]]*)(<locale name=\"C\">)/\1<gettext_domain>$DOMAIN<\/gettext_domain>\n\1\2/; /^[[:space:]]*<locale name=\"[^C]/,/^[[:space:]]*<\/locale>[[:space:]]*\$/ d; /^$/d; s/<\/schema>$/&\n/" "$OUTFILE"
+fi