Using yearistype requires "." in $PATH

Robert Elz kre at munnari.OZ.AU
Sat Aug 5 12:14:26 UTC 2000


The way zic is built, it assumes by default (no -y arg) that
"yearistype" is somewhere in your path.  However (and especially
as it is distributed with the data files these days) yearistype
is usually going to be found in "." which is generally not in
anyone's path (and should never be in root's path).

The NetBSD workaround (in its distributed tzcode) is to run zic
as:
	zic -y "sh yearistype.sh"

and not bother with making "yearistype", including making it executable,
at all.   The tzcode Makefile uses "-y ./yearistype".

Those are OK for a makefile, but not really ideal for one off running zic
by hand.  As things are currently, the -y option is almost mandatory, zic
just doesn't work properly without it, yet it is still optional in zic.

Is there any reason that the distribution couldn't be altered as ...

*** zic.c.old	Mon Jul 31 23:24:18 2000
--- zic.c	Sat Aug 05 21:55:39 2000
***************
*** 538,544 ****
  	if (directory == NULL)
  		directory = TZDIR;
  	if (yitcommand == NULL)
! 		yitcommand = "yearistype";
  
  	setboundaries();
  
--- 538,544 ----
  	if (directory == NULL)
  		directory = TZDIR;
  	if (yitcommand == NULL)
! 		yitcommand = "./yearistype";
  
  	setboundaries();
  
which will work better than now, except in the (somewhat odd I think)
case where yearistype is actually getting installed in some standard binary
directory.   Since it isn't included with tzcode the standard Makefile
doesn't install it anywhere (but does depend upon it), it tends to just
live with the data.

Much better would be to actually look for, and find (when no -y is given)
a suitable yearistype file - look in the directory where the data file
is found (so "zic /usr/src/share/zoneinfo/australasia" would work), and
if not found there, look in "." to see if it is there, and if not there,
just assume it must be in PATH (and so leave it as just "yearistype") or
can't be found at all.   For now, that's more effort than is needed (for me).
The searching should include looking for "yearistype.sh" as well most likely,
and if that's found, and no yearistype is found, then run it as "sh ..."
so it doesn't need 'x' permission).

kre




More information about the tz mailing list