GNOME Bugzilla – Bug 134517
Implement --with-sysconfsubdir in configure
Last modified: 2004-12-22 21:47:04 UTC
This is a modified copy of a message I sent to gconf-list: http://mail.gnome.org/archives/gconf-list/2004-February/msg00005.html (some replies can be found there). First, a bit of background: In pkgsrc (the native NetBSD's packaging system), the user has the ability to configure the system-wide sysconfdir by defining a variable, PKG_SYSCONFBASE, to where it should be. Suppose he does: PKG_SYSCONFBASE=/etc/pkg Then, all packages install their configuration files there, so GConf2 ends using /etc/pkg/gconf as its configuration directory, which contains '2', 'gconf.xml.defaults' and 'gconf.xml.mandatory'. All fine. But this framework is more flexible. It also allow users to specify the configuration directory on a package basis. So, that user could do: PKG_SYSCONFDIR.GConf2=/var/db/gconf And here comes the "problem". Passing that value to GConf2's configure script (through the --sysconfdir argument) means that configuration files will end up in /var/db/gconf/gconf/*, as sources have hardcoded in them the '/gconf/' subdirectory. In pkgsrc, we workaround this by patching GConf2's sources to remove that part of the path on all accesses to the database. But you guessed right: this is error prone, and patches get out of sync on almost every update. My proposal is the following: remove the '/gconf/' part from all paths that refer to the database, and keep it centralized somewhere (that is, in the configure script). This alone will make things more consistent (and in my oppinion, cleaner), as that part of the path won't be hardcoded in the sources. And then, after changing this, allow the user to change the value of the subdirectory. This can be done through a configure argument, which is what the attached patch does. It provides the --with-sysconfsubdir argument that sets the subdirectory under sysconfdir that will be used and modifies sources to strip the '/gconf/' part of paths. Everything will behave as usual unless the user explicitly specifies this option.
Created attachment 24440 [details] [review] Patch to implement --with-sysconfsubdir
This looks fine to me, but I'd like one small thing changed - please refer to the /etc/gconf dir as $(sysgconfdir) to avoid confusion where people expect $(sysconfdir) to be /etc. I'd do it myself and commit, but its better off if you do it and test the change. Thanks :-)
Created attachment 29172 [details] [review] Patch with suggestions implemented This new patch does what you asked for: it introduces a new variable, sysgconfdir, which holds the value of sysconfdir + sysconfsubdir. It doesn't touch sysconfdir's value. I've also changed EXPANDED_SYSCONFDIR to EXPANDED_SYSGCONFDIR and fixed some more occurrences of the configuration directory (though they seem useless, like the one in examples/). Furthermore, it applies correctly to recent CVS code. Hope it looks better now :-)
Thanks Julio, commited to HEAD: 2004-07-04 Mark McLoughlin <mark@skynet.ie> Patch from Julio M. Merino Vidal <jmmv@menta.net> in bug #134517 to add a --sysconfsubdir configure argument which allows the sub-directory GConf uses under $sysconfdir to be change. * configure.in: add --sysconfsubdir argument and subst $sysgconfdir which contains the full sysconf path GConf uses. * Makefile.am, examples/Makefile.am, gconf/Makefile.am, gconf/default.path.in, gconf/gconftool.c, standard-schemas/Makefile.am, wrappers/cxx/Makefile.am: use $sysgconfdir.