After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 134517 - Implement --with-sysconfsubdir in configure
Implement --with-sysconfsubdir in configure
Status: RESOLVED FIXED
Product: GConf
Classification: Deprecated
Component: gconf
CVS HEAD
Other other
: Normal enhancement
: ---
Assigned To: GConf Maintainers
GConf Maintainers
Depends on:
Blocks:
 
 
Reported: 2004-02-16 12:18 UTC by Julio Merino
Modified: 2004-12-22 21:47 UTC
See Also:
GNOME target: ---
GNOME version: Unversioned Enhancement


Attachments
Patch to implement --with-sysconfsubdir (5.05 KB, patch)
2004-02-16 12:18 UTC, Julio Merino
needs-work Details | Review
Patch with suggestions implemented (8.16 KB, patch)
2004-07-02 21:22 UTC, Julio Merino
none Details | Review

Description Julio Merino 2004-02-16 12:18:12 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.
Comment 1 Julio Merino 2004-02-16 12:18:52 UTC
Created attachment 24440 [details] [review]
Patch to implement --with-sysconfsubdir
Comment 2 Mark McLoughlin 2004-07-02 20:04:34 UTC
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 :-)
Comment 3 Julio Merino 2004-07-02 21:22:12 UTC
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
:-)
Comment 4 Mark McLoughlin 2004-07-04 16:24:09 UTC
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.