No calendar.canada, eh?

I just discovered the calendar command which is very cool:

$ sudo apt install calendar -y
[...]
$  calendar
Jun 09 	The Roman Emperor Nero commits suicide, 68
Jun 09 	Senior Citizen's Day in Oklahoma
Jun 09 	Les Paul (Lester Polsfuss) is born in Waukesha, Wisconsin, 1915
Jun 09 	Carl Nielsen is born in Sortelung, Denmark, 1865
Jun 09 	Stanislav Galabov <[email protected]> born in Sofia, Bulgaria, 1978
Jun 09 	N'oubliez pas les Diane !
Jun 09 	Félix
Jun 10 	First Apple II shipped, 1977
Jun 10 	Death of Alexander the Great, 323 B.C.
Jun 10 	Denver police tear gas Jethro Tull and 2000 fans at Red Rocks, 1971
Jun 10 	Camoes Day in Portugal
Jun 10 	Howlin' Wolf (Chester Burnett) is born in West Point, Mississippi, 1910
Jun 10 	Judy Garland is born, 1922
Jun 10 	Ernest Chausson dies in Limary, Seine-et-Oise, France, 1899
Jun 10 	First election of the European Parliament, 1979
Jun 10 	Guillermo Rawson funda la Cruz Roja Argentina, 1880
Jun 10 	Afirmación de los Derechos Argentinos sobre las Malvinas, 1973
Jun 10 	Margit, Gitta, Gréta
Jun 11 	Greeks seize Troy, 1184BC
Jun 11 	Sauron attacks Osgilliath
Jun 11 	King Kamehameha I Day in Hawaii
Jun 11 	Queen's Birthday
Jun 11*	Parshat Beha'alotcha
Jun 11 	Richard Strauss is born in Munich, Germany, 1864
Jun 11 	Juan de Garay funda por segunda vez Buenos Aires, 1580
Jun 11 	Alonso Cardenas Marquez <[email protected]> born in Arequipa, Peru, 1979
Jun 11 	Bonne fête aux Barnabé !
Jun 11 	Aujourd'hui, c'est la St(e) Yolande.
Jun 11 	À la saint Barnabé,
	Fauche ton pré.
Jun 11 	Richard Strauss in München geboren, 1864
Jun 11 	Barnabás
Jun 12 	Nelson Mandela is sentenced to life in prison, 1964
Jun 12 	Independence Day in Philippines
Jun 12 	Peace with Bolivia in Paraguay
Jun 12 	John Ireland dies, 1962
Jun 12*	Queen's Birthday Holiday (Australia, except WA)
Jun 12 	N'oubliez pas les Guy !
Jun 12 	Villõ

According to man the following files should come with it:

FILES
     calendar              File in current directory.
     ~/.calendar           Directory in the user's home directory (which calendar changes into, if it
                           exists).
     ~/.calendar/calendar  File to use if no calendar file exists in the current directory.
     ~/.calendar/nomail    calendar will not send mail if this file exists.
     calendar.all          International and national calendar files.
     calendar.birthday     Births and deaths of famous (and not-so-famous) people.
     calendar.canada       Canadian holidays.
     calendar.christian    Christian holidays (should be updated yearly by the local system administra‐
                           tor so that roving holidays are set correctly for the current year).
     calendar.computer     Days of special significance to computer people.
     calendar.croatian     Croatian calendar.
     calendar.discord      Discordian calendar (all rites reversed).
     calendar.fictional    Fantasy and fiction dates (mostly LOTR).
     calendar.french       French calendar.
     calendar.german       German calendar.
     calendar.history      Miscellaneous history.
     calendar.holiday      Other holidays (including the not-well-known, obscure, and really obscure).
     calendar.judaic       Jewish holidays (should be updated yearly by the local system administrator
                           so that roving holidays are set correctly for the current year).
     calendar.music        Musical events, births, and deaths (strongly oriented toward rock 'n' roll).
     calendar.nz           New Zealand calendar.
     calendar.openbsd      OpenBSD related events.
     calendar.pagan        Pagan holidays, celebrations and festivals.
     calendar.russian      Russian calendar.
     calendar.space        Cosmic history.
     calendar.uk           UK calendar.
     calendar.ushistory    U.S. history.
     calendar.usholiday    U.S. holidays.
     calendar.world        World wide calendar.

Am so so excited that calendar.canada is included that way I can never miss any other of my royals' celebration.

For example by issuing calendar -t 0609 -A 21 -f /usr/share/calendar/calendar.canada I would be querying the CA events for a three-week period. The problem is that this file did not came with the calendar package:

$ ls /usr/share/calendar
calendar.all        calendar.discordian  calendar.judaic       calendar.newzealand     calendar.world
calendar.argentina  calendar.dutch       calendar.judaic.2020  calendar.pagan          de_AT
calendar.australia  calendar.eu          calendar.judaic.2021  calendar.russian        de_DE
calendar.belgium    calendar.freebsd     calendar.judaic.2022  calendar.southafrica    fr_FR
calendar.birthday   calendar.french      calendar.judaic.2023  calendar.thai           hr_HR
calendar.christian  calendar.german      calendar.judaic.2024  calendar.ubuntu         hu_HU
calendar.computer   calendar.history     calendar.kazakhstan   calendar.ukrainian      pt_BR
calendar.croatian   calendar.holiday     calendar.lotr         calendar.unitedkingdom  ru_RU
calendar.debian     calendar.hungarian   calendar.music        calendar.usholiday      uk_UA

So my questions are:

  1. What's the easiest way to get this file installed and
  2. Why is UA listed in there but not CA and
  3. Can moving forward /usr/share/calendar/calendar.canada be included into UM versions?

Cheers!

3 Likes

Hi, @DLS (Daniel LaSalle) :slight_smile:

This took me quite a bit of "detective work"! I eventually found a "calendar.canada" in the OpenBSD files.

Later, I can try to explain better my "detective work". But, for now, here's the direct link to the current version of that "calendar.canada" file in OpenBSD:
https://cvsweb.openbsd.org/cgi-bin/cvsweb/~checkout~/src/usr.bin/calendar/calendars/calendar.canada?content-type=text/plain

EDIT: I've just found another copy in the "Read-only git conversion of OpenBSD's official CVS src repository" in GitHub:

https://github.com/openbsd/src/blob/master/usr.bin/calendar/calendars/calendar.canada

And here's the current textual content of that "calendar.canada" file from the first link:

/*
 * Canada holiday
 *
 * $OpenBSD: calendar.canada,v 1.3 2023/05/15 16:22:07 jmc Exp $
 */

#ifndef _calendar_canada_
#define _calendar_canada_

01/01	New Year's Day (Statutory holiday)
02/02	Groundhog Day
02/14	St. Valentine's Day
02/15	National Flag of Canada Day
03/17	Saint Patrick's Day
03/20*	Vernal Equinox
03/SunSecond	Daylight Saving Time begins; clocks move forward (2nd Sunday of March)
04/01	April Fool's Day
Easter-2	Good Friday (Statutory holiday)
Easter+1	Easter Monday
05/SunSecond	Mother's Day (2nd Sunday of May)
/* Holds up to and including 2015 */
05/Mon-2	Victoria Day (Monday on or immediately before May 24)
06/SunThird	Father's Day (3rd Sunday of June)
06/21*	Summer Solstice
06/24	St-Jean Baptiste
07/01	Canada Day (Statutory holiday)
08/MonFirst	August Civic Holiday
09/MonFirst	Labour Day (Statutory holiday)
09/22*	Autumnal Equinox
10/MonSecond	Thanksgiving
10/31	All Hallows' Eve (Halloween)
11/SunFirst	Daylight Saving Time ends; clocks move back (1st Sunday in November)
11/11	Remembrance Day
12/21*	Winter Solstice
12/24	Christmas Eve
12/25	Christmas Day (Statutory holiday)
12/26	Boxing Day
12/31	New Year's Eve

#endif /* !_calendar_canada_ */
3 Likes

Hello @ricmarques

As usual I really appreciate you picking up the ball and helping me love Linux even more <3

Following the BSD content I went ahead and populated /usr/share/calendar/calendar.canada and tried again but alas it seems that calendar needs to source the file:

$ calendar -t 0612 -A 21 -f /usr/share/calendar/calendar.canada
$ calendar -t 0612 -A 21 -f /usr/share/calendar/calendar.unitedkingdom 
Jun 18*	Father's Day
Jun 18 	Waterloo Day
Jun 24*	Armed Forces Day
Jun 24 	Midsummer (quarter day)
$ ls -l /usr/share/calendar/                      
total 312
-rw-r--r-- 1 root root  1277 Aug  4  2020 calendar.all
-rw-r--r-- 1 root root  6436 Jun 22  2020 calendar.argentina
-rw-r--r-- 1 root root  2416 Jan 28  2022 calendar.australia
-rw-r--r-- 1 root root  2749 Jan 30  2018 calendar.belgium
-rw-r--r-- 1 root root 15664 Jan 28  2022 calendar.birthday
-rw-r--r-- 1 root root  1230 Jun 11 09:56 calendar.canada
[...]

What we can see above is the first command pointing to the canada file that failed. Issuing the same command but pointing on a calendar file that was installed with the package worked as we can see on the 2nd command. Lastly we can see that the ownership is the same on all of the files.

Any idea?

1 Like