Date: Mon, 10 Feb 2014 05:20:31 GMT From: Henry Hu <henry.hu.sh@gmail.com> To: freebsd-gnats-submit@FreeBSD.org Subject: ports/186616: [patch] devel/dconf: load profile and db from correct dir Message-ID: <201402100520.s1A5KVMU090608@cgiserv.freebsd.org> Resent-Message-ID: <201402100530.s1A5U16d056477@freefall.freebsd.org>
next in thread | raw e-mail | index | archive | help
>Number: 186616 >Category: ports >Synopsis: [patch] devel/dconf: load profile and db from correct dir >Confidential: no >Severity: non-critical >Priority: low >Responsible: freebsd-ports-bugs >State: open >Quarter: >Keywords: >Date-Required: >Class: sw-bug >Submitter-Id: current-users >Arrival-Date: Mon Feb 10 05:30:01 UTC 2014 >Closed-Date: >Last-Modified: >Originator: Henry Hu >Release: FreeBSD 11-CURRENT >Organization: Columbia University >Environment: FreeBSD pepsi 11.0-CURRENT FreeBSD 11.0-CURRENT #4 r260031M: Mon Jan 20 19:26:20 EST 2014 root@pepsi:/usr/obj/usr/src/sys/MYKERNEL amd64 >Description: devel/dconf currently loads db and profile from /etc/dconf/db and /etc/dconf profile. It should load these things from /usr/local/etc/dconf. Because ports install profiles into /usr/local/etc/dconf/profile, and ports install db description into /usr/local/etc/dconf/db, and `dconf update` creates db in /usr/local/etc/dconf/db, these bugs prevent applications from using dconf correctly. This is required for the upcoming ibus update. >How-To-Repeat: 1. use some application which use custom profile and db (like experimental ibus in https://svn.redports.org/henryhu/textproc/ibus) 2. try to read/write settings and fail For example, with ibus-daemon running, run qdbus --address `ibus address` org.freedesktop.IBus.Config /org/freedesktop/IBus/Config org.freedesktop/IBus.Config.SetValue engine/Pinyin TestValue 1 results in Error: org.gtk.GDBus.UnmappedGError.Quark._dconf_20error_20quark.Code1 The operation attempted to modify one or more non-writable keys , and with the proposed fix, it works correctly. >Fix: Some paths with prefix "/etc" are hardcoded in dconf. Prepending "/usr/local" to these paths fixes the problem. I'm not sure if "/usr/local" is appropriate, or the patch should refer to ${PREFIX}. Patch attached with submission follows: diff -urN /usr/ports/devel/dconf/files/patch-engine-prefix ./files/patch-engine-prefix --- /usr/ports/devel/dconf/files/patch-engine-prefix 1969-12-31 19:00:00.000000000 -0500 +++ ./files/patch-engine-prefix 2014-02-10 00:07:27.000000000 -0500 @@ -0,0 +1,33 @@ +diff -uNr engine.orig/dconf-engine-profile.c engine/dconf-engine-profile.c +--- engine.orig/dconf-engine-profile.c 2014-02-10 00:04:59.000000000 -0500 ++++ engine/dconf-engine-profile.c 2014-02-10 00:05:39.000000000 -0500 +@@ -188,7 +188,7 @@ + + if (profile == NULL) + { +- file = fopen ("/etc/dconf/profile/user", "r"); ++ file = fopen ("/usr/local/etc/dconf/profile/user", "r"); + + /* Only in the case that no profile was specified do we use this + * fallback. +@@ -198,7 +198,7 @@ + } + else if (profile[0] != '/') + { +- gchar *filename = g_build_filename ("/etc/dconf/profile", profile, NULL); ++ gchar *filename = g_build_filename ("/usr/local/etc/dconf/profile", profile, NULL); + file = fopen (filename, "r"); + g_free (filename); + } +diff -uNr engine.orig/dconf-engine-source-system.c engine/dconf-engine-source-system.c +--- engine.orig/dconf-engine-source-system.c 2014-02-10 00:04:59.000000000 -0500 ++++ engine/dconf-engine-source-system.c 2014-02-10 00:05:14.000000000 -0500 +@@ -48,7 +48,7 @@ + GvdbTable *table; + gchar *filename; + +- filename = g_build_filename ("/etc/dconf/db", source->name, NULL); ++ filename = g_build_filename ("/usr/local/etc/dconf/db", source->name, NULL); + table = gvdb_table_new (filename, FALSE, &error); + + if (table == NULL) >Release-Note: >Audit-Trail: >Unformatted:
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201402100520.s1A5KVMU090608>