Date: Sat, 24 Oct 2020 21:08:14 -0600 From: Warner Losh <imp@bsdimp.com> To: "Rodney W. Grimes" <rgrimes@freebsd.org> Cc: =?UTF-8?B?U3RlZmFuIEXDn2Vy?= <se@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all <svn-src-all@freebsd.org>, svn-src-head <svn-src-head@freebsd.org> Subject: Re: svn commit: r366962 - in head: include usr.bin/calendar Message-ID: <CANCZdfr_mJmOTYY6vPtq4Mo05qtx2VfzW3%2BrWxwSk_5Y7NO3_Q@mail.gmail.com> In-Reply-To: <202010250250.09P2oxbs076549@gndrsh.dnsmgr.net> References: <202010230922.09N9MNZu040921@repo.freebsd.org> <202010250250.09P2oxbs076549@gndrsh.dnsmgr.net>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, Oct 24, 2020 at 8:51 PM Rodney W. Grimes <freebsd@gndrsh.dnsmgr.net> wrote: > [ Charset UTF-8 unsupported, converting... ] > > Author: se > > Date: Fri Oct 23 09:22:23 2020 > > New Revision: 366962 > > URL: https://svnweb.freebsd.org/changeset/base/366962 > > > > Log: > > Add search of LOCALBASE/share/calendar for calendars supplied by a > port. > > > > Calendar files in LOCALBASE override similarily named ones in the base > > system. This could easily be changed if the base system calendars > should > > have precedence, but it could lead to a violation of POLA since then > the > > port's files were ignored unless those in base have been deleted. > > > > There was no definition of _PATH_LOCALBASE in paths.h, but verbatim > uses > > of /usr/local existed for _PATH_DEFPATH. Use _PATH_LOCALBASE here to > ease > > a consistent modification of this prefix. > > > > Reviewed by: imp, pfg > > Differential Revision: https://reviews.freebsd.org/D26882 > > > > Modified: > > head/include/paths.h > > head/usr.bin/calendar/io.c > > head/usr.bin/calendar/pathnames.h > > > > Modified: head/include/paths.h > > > ============================================================================== > > --- head/include/paths.h Fri Oct 23 08:44:53 2020 (r366961) > > +++ head/include/paths.h Fri Oct 23 09:22:23 2020 (r366962) > > @@ -37,8 +37,11 @@ > > > > #include <sys/cdefs.h> > > > > +#define _PATH_LOCALBASE "/usr/local" > > + > > Something feels very wrong about this becoming a defined path in base, > it is further dependence on /usr/local which in the early days we spent > a great deal of time removing. > > I believe the whole ports system allows this to be something other > than /usr/local. Package should also allow it to be some other place. > This removes a couple of instances of /usr/local being hardcoded and replaces with a define, so net it's better. It could be even better, but this is slightly better than it was before. Warner > > /* Default search path. */ > > -#define _PATH_DEFPATH > "/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin" > > +#define _PATH_DEFPATH "/sbin:/bin:/usr/sbin:/usr/bin:" \ > > + _PATH_LOCALBASE "/sbin:" _PATH_LOCALBASE "/bin" > > /* All standard utilities path. */ > > #define _PATH_STDPATH "/usr/bin:/bin:/usr/sbin:/sbin" > > /* Locate system binaries. */ > > > > Modified: head/usr.bin/calendar/io.c > > > ============================================================================== > > --- head/usr.bin/calendar/io.c Fri Oct 23 08:44:53 2020 > (r366961) > > +++ head/usr.bin/calendar/io.c Fri Oct 23 09:22:23 2020 > (r366962) > > @@ -71,7 +71,7 @@ enum { > > }; > > > > const char *calendarFile = "calendar"; /* default calendar file */ > > -static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE}; /* > HOME */ > > +static const char *calendarHomes[] = {".calendar", _PATH_INCLUDE_LOCAL, > _PATH_INCLUDE}; /* HOME */ > > static const char *calendarNoMail = "nomail";/* don't sent mail if file > exist */ > > > > static char path[MAXPATHLEN]; > > > > Modified: head/usr.bin/calendar/pathnames.h > > > ============================================================================== > > --- head/usr.bin/calendar/pathnames.h Fri Oct 23 08:44:53 2020 > (r366961) > > +++ head/usr.bin/calendar/pathnames.h Fri Oct 23 09:22:23 2020 > (r366962) > > @@ -35,3 +35,4 @@ > > #include <paths.h> > > > > #define _PATH_INCLUDE "/usr/share/calendar" > > +#define _PATH_INCLUDE_LOCAL _PATH_LOCALBASE "/share/calendar" > > > > -- > Rod Grimes > rgrimes@freebsd.org >
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CANCZdfr_mJmOTYY6vPtq4Mo05qtx2VfzW3%2BrWxwSk_5Y7NO3_Q>