svn commit: r366962 - in head: include usr.bin/calendar

Stefan Eßer se at FreeBSD.org
Fri Oct 23 09:22:24 UTC 2020


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"
+
 /* 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"


More information about the svn-src-head mailing list