On Sun, Feb 09, 2020 at 04:18:52PM +0100, Ingo Schwarze wrote: > Hi Todd, > > Todd C. Miller wrote on Sun, Feb 09, 2020 at 07:52:10AM -0700: > > > I'm fine with this. > > I don't really object, but i'm not sure it is needed either. > > It's certainly obvious that command line arguments override defaults. > That's what they always do. It's their whole point, in general. > > Also, command line arguments (at least almost) always override > configuration file settings. If they don't, i would usually call > that a serious design error. There may be exceptions, like > configuration settings to enable or disable optional command > line functionality, but that is very unusual.
Personally, I won't necessarily expect that, as I have seen way to many tools doing all kinds of weird things with ordering, e.g. defaults, overridden by local user config, overridden by current env, overridden by global config, overridden by command line flags, etc. In this particular case I had to lookup the order in the code to narrow down the actual issue. Hence I thought it would be a good idea to document this. However, I'm fine with assuming sane defaults on OpenBSD, so not needed then. > > However, it doesn't look like we document /etc/locate.rc anywhere. > > I'm not sure it deserves its own man page > > but I think it should at least be documented in locate.updatedb > > in some fashion. > > It is mentioned there, but not really documented. > > OK? OK jung@ > Ingo > > > Index: locate.updatedb.8 > =================================================================== > RCS file: /cvs/src/usr.bin/locate/locate/locate.updatedb.8,v > retrieving revision 1.18 > diff -u -r1.18 locate.updatedb.8 > --- locate.updatedb.8 10 Dec 2009 00:45:43 -0000 1.18 > +++ locate.updatedb.8 9 Feb 2020 15:14:57 -0000 > @@ -51,10 +51,6 @@ > .Pa /etc/weekly > script. > .Pp > -The contents of the newly built database can be controlled by the > -.Pa /etc/locate.rc > -file as well as the command line arguments. > -.Pp > The options are as follows: > .Bl -tag -width Ds > .It Fl -fcodes > @@ -75,6 +71,14 @@ > .It Fl -tmpdir > Sets the directory temporary files are stored in. > .El > +.Pp > +The default settings are controlled by the configuration file > +.Pa /etc/locate.rc . > +It is a > +.Xr sh 1 > +script that can be used to set variables. > +The names of the variables match the names of the command line > +options, but in all caps. > .Sh FILES > .Bl -tag -width /var/db/locate.database -compact > .It Pa /etc/locate.rc >
