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 318928 - Implement --with-sysconfsubdir in configure
Implement --with-sysconfsubdir in configure
Status: RESOLVED FIXED
Product: gnopernicus
Classification: Deprecated
Component: build
unspecified
Other All
: Normal normal
: ---
Assigned To: Adi Dascal
Adi Dascal
Depends on:
Blocks:
 
 
Reported: 2005-10-15 10:26 UTC by Julio Merino
Modified: 2005-11-29 10:48 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
Sample patch. (4.51 KB, patch)
2005-10-15 10:28 UTC, Julio Merino
accepted-commit_now Details | Review

Description Julio Merino 2005-10-15 10:26:20 UTC
This is an adaptation of bug #134517 filled against GConf, which requested this
same feature in that package and was already successfully fixed.

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 gnopernicus ends
using /etc/pkg/gnopernicus-1.0 as its configuration directory (as pkgsrc gives
--sysconfdir=/etc/pkg to the configure script).  This is 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.gnopernicus=/etc/foo/gnopernicus
 
And here comes the "problem".  Passing that value to gnopernicus' configure 
script (through the --sysconfdir argument) means that configuration files 
will end up in /etc/foo/gnopernicus/gnopernicus-1.0/*, as sources have hardcoded
in them the '/gnopernicus-1.0/' subdirectory.  Thus the user will get an
"unexpected" result.

In pkgsrc, we workaround this by patching gnopernicus' sources to remove that
part of the path on all accesses to the configuration directory.  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 '/gnopernicus-1.0/' part from all paths 
that refer to the configuration directory, 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 Makefile.am files.

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 '/gnopernicus-1.0/' part of paths.
 
Everything will behave as usual unless the user explicitly specifies this
option, so this is non-intrusive.
Comment 1 Julio Merino 2005-10-15 10:28:06 UTC
Created attachment 53506 [details] [review]
Sample patch.
Comment 2 bill.haneman 2005-11-01 15:56:03 UTC
Comment on attachment 53506 [details] [review]
Sample patch.

Looks good to me, on inspection.  BAUM folks, can you test and apply if it
tests out OK?
Comment 3 remus draica 2005-11-22 10:20:22 UTC
Comment on attachment 53506 [details] [review]
Sample patch.


Patch looks fine. Please apply it.
Comment 4 remus draica 2005-11-29 10:47:54 UTC
Comment on attachment 53506 [details] [review]
Sample patch.


Patch committed to cvs head.