Commit Graph

50 Commits

Author SHA1 Message Date
Gleb Smirnoff
e67975d331 Fix 'calendar -a' in several ways.
o Do not run any iconv() processing in -a. The locale of root user is not
  what is desired by most of the users who receive their calendar mail.
  Just assume that users store their calendars in a format that is readable
  to them. This fixes regression from r344340.
o fork() and setusercontext(LOGIN_SETALL) for every user. This makes LANG
  set inside a calendar file mostly excessive, as we will pick up user's
  login class LANG.
o This also executes complex function cal() that parses user owned files
  with appropriate user privileges.
  Previously it was run with privileges dropped only temporary for execution
  of cal(), and fully dropped only before invoking sendmail (see r22473).

Reviewed by:	bapt (older version of patch)
2019-09-10 04:21:48 +00:00
Baptiste Daroussin
adedf5ee31 calendar: use iconv to respect the output encoding
calendar(1) can have input in various encoding, specifying
LANG=<locale_name> to enable calendar(1) to determine which one to use.

The problem is the content of the calendar itself is exposed as is making it
unreadable in many cases. For example french calendar which is encoded
ISO8859-1 is rendered badly in a fr_FR.UTF-8 environment.

Using iconv allows to solve this issue.
This will also allow to keep only 1 encoding in base for those files without
breaking user existing setup

Reported by:	many
MFC after:	1 month
Differential Revision:	https://reviews.freebsd.org/D19221
2019-02-20 06:40:52 +00:00
Brad Davis
e172d4c3f0 Switch calendar installs to use FILES and SYMLINKS instead of bare install(1)
Also explicitly list each file to install so we don't silently add or miss
some.

Approved by:	bapt (mentor)
2018-05-23 16:28:31 +00:00
Enji Cooper
d511b20a69 Add HAS_TESTS to all Makefiles that are currently using the
`SUBDIR.${MK_TESTS}+= tests` idiom.

This is a follow up to r321912.
2017-08-02 08:50:42 +00:00
Enji Cooper
4b330699f8 Convert traditional ${MK_TESTS} conditional idiom for including test
directories to SUBDIR.${MK_TESTS} idiom

This is being done to pave the way for future work (and homogenity) in
^/projects/make-check-sandbox .

No functional change intended.

MFC after:	1 weeks
2017-08-02 08:35:51 +00:00
Glen Barber
509cc8438f Fix packaging calendar(1) files.
Sponsored by:	The FreeBSD Foundation
2016-10-31 20:31:56 +00:00
Baptiste Daroussin
e061f95e7b Rework calendar(1) parser
Support includes surrounded by '"' or '<' '>'
Print warnings about bad syntax
Correctly navigate through include directories to find calendar files
Correctly support multiple includes

Tested by:	gjb
MFC after:	1 week
2015-03-04 20:04:23 +00:00
Baptiste Daroussin
3e11bd9e2a Convert to usr.bin/ to LIBADD
Reduce overlinking
2014-11-25 14:29:10 +00:00
Ed Maste
ff2e520113 Remove extraneous "mkdir -p"
The directory hierarchy is created by an mtree file (BSD.usr.dist,
in the case of calendar(1)).  An explicit "mkdir -p" in a program's
Makefile is redundant, and can mask a missing mtree entry.
2014-06-02 18:30:57 +00:00
Warner Losh
c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Julio Merino
3a92d97ff0 Migrate most of tools/regression/usr.bin/ to the new tests layout.
I'm starting with the easy cases.  The leftovers need to be looked at a
bit more closely.

Note that this change _does_ modify the code of the old tests.  This is
required in order to allow the code to locate the data files in the
source directory instead of the current directory, because Kyua
automatically changes the latter to a temporary directory.

Also note that at least one test is known to be broken here.  Actually,
the test is not really broken: it's marked as a TODO but unfortunately
Kyua's TAP parser currently does not understand that.  Will have to be
fixed separately.
2014-03-16 08:04:06 +00:00
Diane Bruce
5d32a8713c - calendar uses cpp internally, this diff removes this usage and
substitutes a limited subset cpp processor internally.

PR:		src/178463
Approved by:	re (gjb)
2013-09-19 20:17:50 +00:00
Gleb Smirnoff
2c32df4489 Provide UTF-8 version of russian calendars. 2013-08-16 07:02:17 +00:00
Sergey A. Osokin
385a06b917 Add pt_BR.ISO8859-1 and pt_BR.UTF-8 directories to install.
It was forgotten in r219937 commit.

Approved by:	edwin
MFC after:	1 week
2012-02-23 17:47:48 +00:00
Ed Schouten
4a955f14cf Remove extraneous WARNS=7.
WARNS above 6 has no use. Also, all of usr.bin is also built with
WARNS=6 by default.

Discussed with:	edwin
2011-10-08 07:20:12 +00:00
Ulrich Spörlein
9c4bab2ddc Pet make checkdpadd. 2010-11-25 19:22:24 +00:00
Edwin Groothuis
0b0b030bc6 Bump WARNS to 7 2010-03-29 07:08:47 +00:00
Edwin Groothuis
2b84020d5c Long awaited update to the calendar system:
- Repeating events which span multiple years (because of -A, -B or
  just the three days before the end of the year).

- Support for lunar events (full moon, new moon) and solar events
  (equinox and solstice, chinese new year). Because of this, the
  options -U (UTC offset) and -l (longitude) are available to
  compensate if reality doesn't match the calculated values.

MFC after:	1 month
2010-03-29 06:49:20 +00:00
Ed Schouten
b7946da96b Build usr.bin/ with WARNS=6 by default.
Also add some missing $FreeBSD$ to keep svn happy.
2010-01-02 10:27:05 +00:00
Ruslan Ermilov
2ad08c56d8 Add some significant Ukrainian dates.
PR:		88076
Submitted by:	Andriy Gapon
2005-10-28 21:25:28 +00:00
David Malone
7f28a4189b Add Hungarian calendar entries.
PR:		42725
Submitted by:	Janos Mohacsi <janos.mohacsi@bsd.hu>
2004-08-16 09:31:09 +00:00
Josef El-Rayes
dd17ea59d7 Add austrian calendar as install target.
Approved by:	le
Pointed out by:	stefanf
2004-06-04 11:30:52 +00:00
Andrey A. Chernov
1d35769ff1 Remove deprecated locale names 2003-06-10 01:54:10 +00:00
David E. O'Brien
e5009256fb This builds fine with WARNS.
Tested on:	sparc64, athlon[32]
2002-12-30 09:41:07 +00:00
Ruslan Ermilov
d2893b161b Drop support for COPY, -c has been the default mode of install(1)
for a long time now.

Approved by:	bde
2002-07-29 09:40:17 +00:00
Ruslan Ermilov
0b87f79976 s/${INSTALL} -c/${INSTALL} ${COPY}/ 2002-07-18 12:07:49 +00:00
Greg Lehey
9b838be73b beforeinstall target:
- Remove superfluous ;
- create destination directories if they don't exist.
2002-06-13 21:21:59 +00:00
David Malone
d0b3489447 Make a link from fr_FR.ISO8859-1 to fr_FR.ISO8859-15.
Submitted by:	wollman
2002-05-13 21:30:23 +00:00
David Malone
d00a7c247a Don't use ISO_8859 when I should use ISO8859. 2002-04-29 20:57:36 +00:00
David Malone
df374705d2 Add a French calendar.
PR:		32265
Submitted by:	Thierry Thomas <thierry@pompo.net>
MFC after:	1 week
2002-04-28 23:22:13 +00:00
Mark Murray
e35f9517d6 Remove NO_WERRORs and WARNS=n's. To be revisited after GCC3. 2002-02-08 23:07:37 +00:00
Mark Murray
91bd71d206 Remove leaf node WARNS?=2 (that mainly I added). This should
help the GCC3 transition and CURRENT in general.
2002-02-08 22:31:43 +00:00
Mark Murray
9e1e9c4421 WARNS=2 fixup (mostly. Some are Hard To Fix(tm), so NO_WERROR is set)
Use __FBSDID().
Sort some headers.
2001-12-02 22:44:14 +00:00
Dima Dorfman
f5b00d08b1 Nuke spaces in front of tabs. 2001-11-04 23:20:52 +00:00
Andrey A. Chernov
b04359b9b7 ISO_ -> ISO 2001-06-11 02:59:46 +00:00
Andrey A. Chernov
3f5975dca5 Add new and Latin15 names 2001-06-10 18:03:53 +00:00
Alexey Zelkin
f897bc64ea Rename calendars/ru_SU.KOI8-R to calendars/ru_RU.KOI8-R to reflect
locale name change (ru_SU.KOI8-R -> ru_RU.KOI8-R)

Not objected to by:	ache
2000-05-04 11:35:27 +00:00
Alexey Zelkin
2c21592792 Add missing $FreeBSD$ tags 2000-05-04 11:28:55 +00:00
Andrey A. Chernov
d15a8f58a4 Add russian data handling 1996-05-10 21:39:38 +00:00
Andrey A. Chernov
ab5dc10734 Localize it
Handle Orthodox Eastern
-Wall cleanup
1996-05-10 16:30:22 +00:00
John Polstra
ffac7b875e Removed the definition of the make variable SHAREDIR. It was clashing
with the definition in bsd.own.mk, causing "make world" to fall over.
1996-04-02 22:26:18 +00:00
Wolfram Schneider
921e4281bd Submitted by: bruce
replace shell loop with make(1) builtin loop
1996-02-18 19:29:45 +00:00
Wolfram Schneider
30c00b0d9b more verbose output during install foreign calendar files 1996-02-18 01:42:44 +00:00
Wolfram Schneider
7dd8098387 Submitted by: Slaven Rezic (Tomic) <eserte@cs.tu-berlin.de>
croatian calendar
1996-02-09 14:35:02 +00:00
Andrey A. Chernov
0ae3124381 Don't make directory here, it is mtree task 1996-02-05 17:35:17 +00:00
Wolfram Schneider
c9c822e632 - handle events that move around from year to year, i.e.,
``the last Monday in April'
- handle easter

new options
	-f calendarfile
	-A days
	-B days

Calendar HOME directory ~/.calendar
don't sent mail if ~/.calendar/nomail exist
1996-02-02 06:02:41 +00:00
Peter Wemm
b22a0751b7 de_DE.ISO8859-1 -> de_DE.ISO_8859-1 after repository operation on
Andrey's request.
1996-01-30 18:24:32 +00:00
Wolfram Schneider
b206b6bf2b install new calendars/de_DE.ISO8859-1/calendar.* files 1996-01-29 00:31:29 +00:00
Bruce Evans
9c0dc173cc Change install' to ${INSTALL}' so that default install flags can be
specified in the top level Makefiles.
1995-07-25 00:37:58 +00:00
Rodney W. Grimes
9b50d90275 BSD 4.4 Lite Usr.bin Sources 1994-05-27 12:33:43 +00:00