Wed, 11 May 2005 14:09:03 +0200
On 11.05.05, Paul Boekholt wrote:
> On Tue, 10 May 2005 13:51:40 +0200, "G. Milde" <firstname.lastname@example.org> said:
> > However, as I see it, there are up to 4 parties that might want to
> > configure/setup jed:
> Yes, but there are two JEDs to consider: some people (like me) build their
> JED from source and install it in /usr/local.
In this case, the "packager" level is void and
JED_ROOT == /usr/local/[...]?jed
> > * Site administrator --> /usr/local/etc/jed.conf
> Why should a site administrator edit a configuration file in /usr/local if
> his JED is not local?
Well, I suppose her not to edit /usr/local/etc/jed.conf but to create
one, just in case the settings should be kept separate from the
distribution (e.g. Debian) defaults.
While /etc/jed.conf might be changed and the debian configuration will
take care not to overwrite it, updating jed is easier, when it is not
OTHOH, your example with parallel debian-jed and local-jed shows that it
might be wiser not to consider this. (Debian using site administrators
can put their settings e.g. in a file in the /etc/jed-init.d/ directory).
> > - else foreach (["/etc/jed.conf", "/usr/local/etc/jed.conf", "/usr/etc/jed.conf"])
> There is something funny about this:
> loading /usr/local/jed/lib/site.slc
> loading /usr/local/jed/lib/os.sl
> loading /usr/local/jed/lib/menus.slc
> loading /etc/jed.conf
> loading /etc/jed-init.d/00debian.sl
> The /etc/jed.conf here belongs to the old Debian JED package (JED 0.99.15) I
> have installed, but my local JED 0.99.17 does not know that.
How should it? Maybe check if JED_ROOT starts with "/usr/local" and purge
the Jed_Conf_Files list?
> > + foreach (["/etc/jed.conf", "/usr/etc/jed.conf", "/usr/local/etc/jed.conf"])
> For me, this would still load jed.conf and then 00debian.sl
> A locally installed JED should probably not load a debian-specific file just
> because it is on Debian and a Debian JED happens to be installed as well.
This raises the more generic question: should a locally installed program
read configuration files in /etc/ (which might belong to non-local
programs or be just leftovers)?
If the answer is no, the following might help:
% This code fragment looks for the existence of "defaults.sl" and loads
% it. This file IS NOT distributed with JED.
static variable Jed_Conf_Files;
() = evalfile("defaults");
if (is_substr(JED_ROOT, "/usr/local" == 1))
Jed_Conf_Files = "/usr/local/etc/jed.conf";
Jed_Conf_Files = "/etc/jed.conf,/usr/etc/jed.conf";
foreach (strchop(Jed_Conf_Files',', 0))
$1 = ();
if (1 == file_status ($1))
() = evalfile ($1);
BTW: Is there need for /usr/etc/jed.conf or could this one leaved out
making the code even easier by dropping the foreach loop.