gsettings: stay compatible with installed schemas
authorRyan Lortie <desrt@desrt.ca>
Thu, 9 Apr 2015 01:55:58 +0000 (21:55 -0400)
committerRyan Lortie <desrt@desrt.ca>
Thu, 9 Apr 2015 02:35:35 +0000 (22:35 -0400)
commit2b8f131599842d7d6249815412a261df6fa65d15
tree688bfc291def13f444d98f06ccb282d97385abd5
parent89d46d1bdc49755ff99982fb124ec081a2297c12
gsettings: stay compatible with installed schemas

Bug 747209 introduced an error when multiple <summary> or <description>
tags are found for a single key in a GSettings schema.  This check
should have been present from the start, but it was left out because the
schema compiler doesn't include these items in the cache file.  Even
still -- part of the schema compiler's job is validation, and it should
be enforcing proper syntax here.

Repeated <summary> and <description> tags are a semi-common problem when
intltool has been misconfigured in the build system of a package, but
it's possible to imagine mistakes being made by hand as well.

The idea is that these problems would be caught during the build of a
package and maintainers would be forced to fix their build systems.

An unintended side-effect of this change, however, is that the schema
compiler started ignoring already-installed schemas that contained these
problems, when rebuilding the cache.  This means that the installation
of _any_ application would cause the regeneration of the entire cache,
with these already-installed applications being excluded.  Without the
schema in the cache, the application would crash on next startup.

The validation check in the gsettings m4 macro passes --strict to the
compiler, which is not used when rebuilding the cache after
installation.  Pass this flag down into the parser and only throw the
error in case --strict was given.  This will result in the (desired)
build failure without also causing already-installed apps to stop
functioning.

This means that we will not get even a warning about the invalid schema
file in the already-installed case, but that's fine.  There is no sense
spamming the user with these messages when they are already quite fatal
for the developer at build time.

https://bugzilla.gnome.org/show_bug.cgi?id=747472
gio/glib-compile-schemas.c