diff options
author | Colin Walters <walters@verbum.org> | 2012-01-15 09:43:59 -0500 |
---|---|---|
committer | Colin Walters <walters@verbum.org> | 2012-04-25 16:07:36 -0400 |
commit | aecbe27c1b08f517c0e05f03308d3ac55cef490c (patch) | |
tree | 283377bcfc7cf1f504da8d4d9f2682a28a95c4ca /pango/querymodules.c | |
parent | 04664794a8f239eb51e1bf537b42ea6f289336db (diff) | |
download | pango-aecbe27c1b08f517c0e05f03308d3ac55cef490c.tar.gz |
querymodules: Add --system argument
When run as a system trigger, we really don't want to be consulting
e.g. /root/.pangorc. Also, the OSTree build system can run as
non-root, but we don't in this case want to look at /home/user since
the user may not even exist in the password database inside the
chroot.
https://bugzilla.gnome.org/show_bug.cgi?id=667960
Diffstat (limited to 'pango/querymodules.c')
-rw-r--r-- | pango/querymodules.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/pango/querymodules.c b/pango/querymodules.c index ef2d09a3..a1eec703 100644 --- a/pango/querymodules.c +++ b/pango/querymodules.c @@ -44,6 +44,8 @@ #endif #define SOEXT_LEN ((int) strlen (SOEXT)) +static gboolean system_mode; + static gboolean string_needs_escape (const char *str) { @@ -205,6 +207,8 @@ main (int argc, char **argv) { {"version", 0, G_OPTION_FLAG_NO_ARG, G_OPTION_ARG_CALLBACK, &show_version, "Show version numbers", NULL}, + {"system", 0, 0, G_OPTION_ARG_NONE, &system_mode, + "Do not load configuration from home directory", NULL}, {NULL} }; @@ -237,7 +241,10 @@ main (int argc, char **argv) char **dirs; int i; - path = pango_config_key_get ("Pango/ModulesPath"); + if (system_mode) + path = pango_config_key_get_system ("Pango/ModulesPath"); + else + path = pango_config_key_get ("Pango/ModulesPath"); if (!path) path = g_build_filename (pango_get_lib_subdirectory (), MODULE_VERSION, |