summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRyan Lortie <desrt@desrt.ca>2014-02-05 11:39:38 +0000
committerRyan Lortie <desrt@desrt.ca>2014-02-05 11:39:38 +0000
commit1b22c186775c11cd061757745359375b7c340f06 (patch)
treee9ab2a74b0f8a193242cd3f8cb504a9a312a6158
parent79285a11df24ec54b9451b25d14f5d61bb8046ab (diff)
downloaddconf-1b22c186775c11cd061757745359375b7c340f06.tar.gz
dconf compile: always write little endian
-rw-r--r--bin/dconf-update.vala5
-rw-r--r--docs/dconf-tool.xml8
2 files changed, 11 insertions, 2 deletions
diff --git a/bin/dconf-update.vala b/bin/dconf-update.vala
index 556dc70..d452092 100644
--- a/bin/dconf-update.vala
+++ b/bin/dconf-update.vala
@@ -236,8 +236,11 @@ void dconf_compile (string[] args) throws GLib.Error {
}
try {
+ // We always write the result of "dconf compile" as little endian
+ // so that it can be installed in /usr/share
var table = read_directory (args[3]);
- table.write_contents (args[2]);
+ var should_byteswap = (BYTE_ORDER == ByteOrder.BIG_ENDIAN);
+ table.write_contents (args[2], should_byteswap);
} catch (Error e) {
printerr ("%s\n", e.message);
Process.exit (1);
diff --git a/docs/dconf-tool.xml b/docs/dconf-tool.xml
index c359eda..c606616 100644
--- a/docs/dconf-tool.xml
+++ b/docs/dconf-tool.xml
@@ -148,7 +148,13 @@
<varlistentry>
<term><option>compile</option></term>
- <listitem><para>Compile a binary database from keyfiles.</para></listitem>
+ <listitem>
+ <para>Compile a binary database from keyfiles.</para>
+ <para>
+ The result is always in little-endian byte order, so it can be safely installed in 'share'. If it
+ is used on a big endian machine, dconf will automatically byteswap the contents on read.
+ </para>
+ </listitem>
</varlistentry>
<varlistentry>