Tunable sysconfdir subdirectory



Hi all,

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).  I.e., change EXPANDED_SYSCONFDIR to also include
the subdirectory part.  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 (--with or
--enable), though I feel it's an overkill, since this feature will be used by
very few people and would otherwise confuse others.  Another way to do this
is by an environmental variable that can be set before running configure,
which is more obscure, but also effective.

I'm writting to the mailing list before posting a patch as a bug report
because I would like to know if there are chances that this gets accepted.
If so, which approach do you prefer? configure argument or variable?
Comments?

Thanks!

-- 
Julio M. Merino Vidal <jmmv menta net>
The NetBSD Project - http://www.NetBSD.org/



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]