summaryrefslogtreecommitdiffstats
path: root/extra/gconf/gconf-merge-schema
diff options
context:
space:
mode:
authorsibel <sibel@free.fr>2010-04-19 15:46:23 +0200
committersibel <sibel@free.fr>2010-04-19 15:46:23 +0200
commit688ade8e628f47ff03a5d09f269e59bcfcfe5a8c (patch)
tree411fb4dd444e1c54566fbfba87583b15b187cbc0 /extra/gconf/gconf-merge-schema
parentf95bb3b98c23b0fe7056a9a078112114deb3e777 (diff)
downloadnutyx-pakxe-688ade8e628f47ff03a5d09f269e59bcfcfe5a8c.tar.gz
nutyx-pakxe-688ade8e628f47ff03a5d09f269e59bcfcfe5a8c.tar.bz2
nutyx-pakxe-688ade8e628f47ff03a5d09f269e59bcfcfe5a8c.tar.xz
nutyx-pakxe-688ade8e628f47ff03a5d09f269e59bcfcfe5a8c.zip
Maj de gconf#2.28.1-1
Diffstat (limited to 'extra/gconf/gconf-merge-schema')
-rw-r--r--extra/gconf/gconf-merge-schema34
1 files changed, 34 insertions, 0 deletions
diff --git a/extra/gconf/gconf-merge-schema b/extra/gconf/gconf-merge-schema
new file mode 100644
index 000000000..992c162e6
--- /dev/null
+++ b/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