Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 24 Oct 2020 19:50:59 -0700 (PDT)
From:      "Rodney W. Grimes" <freebsd@gndrsh.dnsmgr.net>
To:        =?UTF-8?Q?Stefan_E=C3=9Fer?= <se@freebsd.org>
Cc:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   Re: svn commit: r366962 - in head: include usr.bin/calendar
Message-ID:  <202010250250.09P2oxbs076549@gndrsh.dnsmgr.net>
In-Reply-To: <202010230922.09N9MNZu040921@repo.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
[ 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.

>  /* 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?202010250250.09P2oxbs076549>