mirror of
https://salsa.debian.org/dskoll/remind.git
synced 2026-04-16 14:28:40 +02:00
Compare commits
17 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d90e74b1a3 | ||
|
|
bbd8a4b729 | ||
|
|
cae3e18717 | ||
|
|
0e989a7422 | ||
|
|
7b7ce5bb57 | ||
|
|
df95cdaad0 | ||
|
|
3026b6e5c2 | ||
|
|
b3306c5572 | ||
|
|
9ef3be33e5 | ||
|
|
292262c128 | ||
|
|
e54bfe9197 | ||
|
|
c56cfe9e1d | ||
|
|
f6b6a3285c | ||
|
|
6b031b0fdf | ||
|
|
2dab7025ba | ||
|
|
7403114897 | ||
|
|
82cbeec560 |
2
configure
vendored
2
configure
vendored
@@ -3949,7 +3949,7 @@ _ACEOF
|
||||
fi
|
||||
done
|
||||
|
||||
VERSION=03.01.11
|
||||
VERSION=03.01.13
|
||||
|
||||
ac_config_files="$ac_config_files src/Makefile www/Makefile src/version.h"
|
||||
|
||||
|
||||
@@ -75,6 +75,6 @@ if test "$GCC" = yes; then
|
||||
fi
|
||||
|
||||
AC_CHECK_FUNCS(setenv unsetenv glob mbstowcs setlocale)
|
||||
VERSION=03.01.11
|
||||
VERSION=03.01.13
|
||||
AC_SUBST(VERSION)
|
||||
AC_OUTPUT(src/Makefile www/Makefile src/version.h)
|
||||
|
||||
@@ -1,5 +1,22 @@
|
||||
CHANGES TO REMIND
|
||||
|
||||
* Version 3.1 Patch 13 - 2013-03-22
|
||||
|
||||
- BUG FIX: Sunrise/Sunset calculations greatly improved thanks to John
|
||||
McGowan. Accuracy should now be within a couple of minutes in most
|
||||
places.
|
||||
|
||||
- BUG FIX: Allow specification of margins as low as 0 points in rem2ps,
|
||||
courtesy of Jonathan Kamens.
|
||||
|
||||
- BUG FIX: Permit compilation with gcc 2.95 (which doesn't allow variable
|
||||
declarations after non-declaration statements in a block.)
|
||||
|
||||
- BUG FIX: Several minor documentation errors corrected courtesy of
|
||||
Simon Ruderich.
|
||||
|
||||
- BUG FIX: Spurious test harness failure was fixed.
|
||||
|
||||
* Version 3.1 Patch 12 - 2012-01-23
|
||||
|
||||
- NEW FEATURE: Many substitution sequences "%x" have an alternate mode
|
||||
@@ -562,7 +579,7 @@ CHANGES TO REMIND
|
||||
+ BUG FIXES
|
||||
|
||||
- Fixed sunset(), sunrise() and minsfromutc() functions which were broken
|
||||
by 3.0.17. (In 3.0.17, they did not account for daylight savings time.)
|
||||
by 3.0.17. (In 3.0.17, they did not account for daylight saving time.)
|
||||
|
||||
- Updated "finnish.h" to include proper URL and translation of all
|
||||
error messages.
|
||||
|
||||
@@ -307,8 +307,8 @@ REM Mar 17 MSG %"St. Patrick's%" Day
|
||||
|
||||
# The DST rules are accurate for most locations in
|
||||
# North America
|
||||
REM Sun Apr 1 ++2 UNTIL 1 Jan 2007 MSG Daylight Savings Time - %"DST starts%" %b
|
||||
REM Sun Mar 8 ++2 FROM 1 Jan 2007 MSG Daylight Savings Time - %"DST starts%" %b
|
||||
REM Sun Apr 1 ++2 UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
REM Sun Mar 8 ++2 FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST starts%" %b
|
||||
|
||||
REM Apr 1 MSG %"April Fool's%" Day
|
||||
REM Mon Tue Wed Thu Fri Sat 15 Apr MSG %"Income tax%" due
|
||||
@@ -327,8 +327,8 @@ REM Nov 11 MSG %"Veterans Day%"
|
||||
|
||||
# The DST rules are accurate for most locations in
|
||||
# North America
|
||||
REM Sun [_last(Oct)] UNTIL 1 Jan 2007 MSG Daylight Savings Time - %"DST over%"
|
||||
REM Sun 1 Nov FROM 1 Jan 2007 MSG Daylight Savings Time - %"DST over%"
|
||||
REM Sun [_last(Oct)] UNTIL 1 Jan 2007 MSG Daylight Saving Time - %"DST over%"
|
||||
REM Sun 1 Nov FROM 1 Jan 2007 MSG Daylight Saving Time - %"DST over%"
|
||||
|
||||
REM Oct 30 MSG %"Mischief Night%"
|
||||
REM Oct 31 MSG %"Halloween%"
|
||||
|
||||
31
man/remind.1
31
man/remind.1
@@ -236,20 +236,17 @@ pops up a window and displays its invocation arguments. You could use:
|
||||
.PP
|
||||
to have all of your \fBMSG\fR-type reminders processed using xmessage.
|
||||
.PP
|
||||
A word of warning: It is very easy to spawn dozens of xmessage processes
|
||||
with the above technique. So be very careful. Also, the \fIcmd\fR is passed
|
||||
as an argument to \fBsprintf()\fR. If you use formatting directives other
|
||||
than %s, or use more than one %s directive, there's a good chance that
|
||||
you'll crash \fBRemind\fR. Finally, because all shell and whitespace
|
||||
characters are escaped, the program you execute with the \fB\-k\fR
|
||||
option must be prepared to handle the entire message as a single argument.
|
||||
A word of warning: It is very easy to spawn dozens of xmessage
|
||||
processes with the above technique. So be very careful. Because all
|
||||
shell and whitespace characters are escaped, the program you execute
|
||||
with the \fB\-k\fR option must be prepared to handle the entire
|
||||
message as a single argument.
|
||||
.RE
|
||||
.TP
|
||||
\fB\-z\fR[\fIn\fR]
|
||||
Runs \fBRemind\fR in the daemon mode. If \fIn\fR is supplied, it
|
||||
specifies how often (in minutes) \fBRemind\fR should wake up to
|
||||
check if the reminder script has been changed. \fIN\fR defaults
|
||||
to 5, and can range from 5 to 60. Note that the use of the
|
||||
\fB\-z\fR[\fIn\fR] Runs \fBRemind\fR in the daemon mode. If \fIn\fR
|
||||
is supplied, it specifies how often (in minutes) \fBRemind\fR should
|
||||
wake up to check if the reminder script has been changed. \fIN\fR
|
||||
defaults to 1, and can range from 1 to 60. Note that the use of the
|
||||
\fB\-z\fR option also enables the \fB\-f\fR option.
|
||||
.PP
|
||||
.RS
|
||||
@@ -1461,7 +1458,7 @@ administrator.)
|
||||
If you specify a filename of "-" in the \fBINCLUDE\fR command, \fBRemind\fR
|
||||
will begin reading from standard input.
|
||||
.PP
|
||||
If you specify a \fIdirectory\fR as the argument to \fBINCLDUE\fR, then
|
||||
If you specify a \fIdirectory\fR as the argument to \fBINCLUDE\fR, then
|
||||
\fBRemind\fR will process all files in that directory that match the shell
|
||||
patterm "*.rem". The files are processed in sorted order; the sort order
|
||||
matches that used by the shell when it expands "*.rem".
|
||||
@@ -1930,10 +1927,10 @@ reminder. The default is 0.
|
||||
The standard Unix library functions may have difficulty dealing with dates
|
||||
later than 2037. If this variable is set to 1, then the UTC calculations
|
||||
"fold back" years later than 2037 before using the Unix library functions.
|
||||
For example, to find out whether or not daylight savings time is in
|
||||
For example, to find out whether or not daylight saving time is in
|
||||
effect in June, 2077, the year is "folded back" to 2010, because both
|
||||
years begin on a Monday, and both are non-leapyears. The rules for
|
||||
daylight savings time are thus presumed to be identical for both
|
||||
daylight saving time are thus presumed to be identical for both
|
||||
years, and the Unix library functions can handle 2010. By default,
|
||||
this variable is 0. Set it to 1 if the sun or UTC functions misbehave
|
||||
for years greater than 2037.
|
||||
@@ -1990,7 +1987,7 @@ The number of minutes between Universal Time Coordinated and local time. If
|
||||
\fB$CalcUTC\fR is non-zero, this is calculated upon startup of \fBRemind\fR.
|
||||
Otherwise, you must set it explicitly. If \fB$CalcUTC\fR is zero,
|
||||
then \fB$MinsFromUTC\fR is used in the astronomical calculations. You
|
||||
must adjust it for daylight savings time yourself. Also, if you
|
||||
must adjust it for daylight saving time yourself. Also, if you
|
||||
want to initialize \fB$MinsFromUTC\fR
|
||||
using the \fB\-i\fR command-line option, you
|
||||
must also set \fB$CalcUTC\fR to 0 with the \fB\-i\fR option.
|
||||
@@ -2402,7 +2399,7 @@ The optional parameter \fIstart\fR specifies the position in
|
||||
.RE
|
||||
.TP
|
||||
.B isdst([d_date [,t_time]]) \fRor\fB isdst(q_datetime)
|
||||
Returns a positive number if daylight savings time is in
|
||||
Returns a positive number if daylight saving time is in
|
||||
effect on the specified date and time. \fIDate\fR
|
||||
defaults to \fBtoday()\fR and \fItime\fR defaults to midnight.
|
||||
.RS
|
||||
|
||||
@@ -41,7 +41,7 @@ test: remind
|
||||
@sh ../tests/test-rem
|
||||
|
||||
.c.o:
|
||||
@CC@ -c @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $<
|
||||
@CC@ -c @CPPFLAGS@ @CFLAGS@ @DEFS@ $(CEXTRA) $(LANGDEF) -I. -I$(srcdir) $<
|
||||
|
||||
rem2ps: rem2ps.o dynbuf.o
|
||||
@CC@ @LDFLAGS@ $(LDEXTRA) -o rem2ps rem2ps.o dynbuf.o
|
||||
|
||||
@@ -178,7 +178,7 @@
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many attempts to resolve a weird date spec? */
|
||||
/*---------------------------------------------------------------------*/
|
||||
#define TRIG_ATTEMPTS 50
|
||||
#define TRIG_ATTEMPTS 500
|
||||
|
||||
/*---------------------------------------------------------------------*/
|
||||
/* How many global omits of the form YYYY MM DD do we handle? */
|
||||
|
||||
42
src/funcs.c
42
src/funcs.c
@@ -1791,7 +1791,7 @@ static int FEasterdate(func_info *info)
|
||||
/* */
|
||||
/* FIsdst and FMinsfromutc */
|
||||
/* */
|
||||
/* Check whether daylight savings time is in effect, and */
|
||||
/* Check whether daylight saving time is in effect, and */
|
||||
/* get minutes from UTC. */
|
||||
/* */
|
||||
/***************************************************************/
|
||||
@@ -1855,12 +1855,9 @@ static int FTimeStuff(int wantmins, func_info *info)
|
||||
static int SunStuff(int rise, double cosz, int jul)
|
||||
{
|
||||
int mins, hours;
|
||||
int dusk_or_dawn;
|
||||
int year, mon, day;
|
||||
int jan0;
|
||||
double jan0d;
|
||||
|
||||
double M, L, tanA, sinDelta, cosDelta, a, a_hr, cosH, t, H, T;
|
||||
double M, L, sinDelta, cosDelta, a, a_hr, cosH, t, H, T;
|
||||
double latitude, longdeg, UT, local;
|
||||
|
||||
/* Get offset from UTC */
|
||||
@@ -1880,10 +1877,7 @@ static int SunStuff(int rise, double cosz, int jul)
|
||||
|
||||
|
||||
FromJulian(jul, &year, &mon, &day);
|
||||
jan0 = jul - Julian(year, 0, 1);
|
||||
jan0d = (double) jan0;
|
||||
|
||||
dusk_or_dawn = rise;
|
||||
if (rise > 1)
|
||||
rise -= 2;
|
||||
|
||||
@@ -1891,10 +1885,8 @@ static int SunStuff(int rise, double cosz, int jul)
|
||||
t = (double) jul;
|
||||
if (rise) {
|
||||
t += (6.0 + longdeg/15.0) / 24.0;
|
||||
jan0d += (6.0 + longdeg/15.0) / 24.0;
|
||||
} else {
|
||||
t += (18.0 + longdeg/15.0) / 24.0;
|
||||
jan0d += (18.0 + longdeg/15.0) / 24.0;
|
||||
}
|
||||
|
||||
/* Mean anomaly of sun starting from 1 Jan 1990 */
|
||||
@@ -1902,34 +1894,22 @@ static int SunStuff(int rise, double cosz, int jul)
|
||||
#if BASE != 1990
|
||||
#error Sun calculations assume a BASE of 1990!
|
||||
#endif
|
||||
M = (0.9856002585 * t) + 357.828757; /* In degrees */
|
||||
t = 0.9856002585 * t;
|
||||
M = t + 357.828757; /* In degrees */
|
||||
|
||||
/* Make sure M is in the range [0, 360) */
|
||||
M -= (floor(M/360.0) * 360.0);
|
||||
|
||||
/* Sun's true longitude */
|
||||
L = M + 1.916*sin(DEGRAD*M) + 0.02*sin(2*DEGRAD*M) + 282.565;
|
||||
L = M + 1.916*sin(DEGRAD*M) + 0.02*sin(2*DEGRAD*M) + 283.07080214;
|
||||
if (L > 360.0) L -= 360.0;
|
||||
|
||||
/* Tan of sun's right ascension */
|
||||
tanA = 0.91746 * tan(DEGRAD*L);
|
||||
a = RADDEG * atan(tanA);
|
||||
|
||||
/* Move a into same quadrant as L */
|
||||
if (0.0 <= L && L < 90.0) {
|
||||
if (a < 0.0) a += 180.0;
|
||||
} else if (90.0 <= L && L < 180.0) {
|
||||
a += 180.0;
|
||||
} else if (180.0 <= L && L < 270.0) {
|
||||
a += 180.0;
|
||||
} else {
|
||||
if (a > 0.0) a += 180.0;
|
||||
a = RADDEG * atan2(0.91746*sin(DEGRAD*L), cos(DEGRAD*L));
|
||||
if (a<0) {
|
||||
a += 360.0;
|
||||
}
|
||||
/* if (fabs(a - L) > 90.0)
|
||||
a += 180.0; */
|
||||
|
||||
if (a > 360.0)
|
||||
a -= 360.0;
|
||||
|
||||
a_hr = a / 15.0;
|
||||
|
||||
/* Sine of sun's declination */
|
||||
@@ -1951,7 +1931,9 @@ static int SunStuff(int rise, double cosz, int jul)
|
||||
H = RADDEG * acos(cosH);
|
||||
if (rise) H = 360.0 - H;
|
||||
|
||||
T = H / 15.0 + a_hr - 0.065710 * jan0d - 6.620;
|
||||
t -= 360.0*floor(t/360.0);
|
||||
T = (H-t) / 15.0 + a_hr - 6.726637276;
|
||||
|
||||
if (T >= 24.0) T -= 24.0;
|
||||
else if (T < 0.0) T+= 24.0;
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@
|
||||
* v = Dump variables at end
|
||||
* l = Display entire line in error messages
|
||||
* -e = Send messages normally sent to stderr to stdout instead
|
||||
* -z[n] = Daemon mode waking up every n (def 5) minutes.
|
||||
* -z[n] = Daemon mode waking up every n (def 1) minutes.
|
||||
* -bn = Time format for cal (0, 1, or 2)
|
||||
* -xn = Max. number of iterations for SATISFY
|
||||
* -uname = Run as user 'name' - only valid when run by root. If run
|
||||
@@ -622,7 +622,7 @@ void Usage(void)
|
||||
fprintf(ErrFp, " -a Don't trigger timed reminders immediately - just queue them\n");
|
||||
fprintf(ErrFp, " -q Don't queue timed reminders\n");
|
||||
fprintf(ErrFp, " -f Trigger timed reminders by staying in foreground\n");
|
||||
fprintf(ErrFp, " -z[n] Enter daemon mode, waking every n (5) minutes.\n");
|
||||
fprintf(ErrFp, " -z[n] Enter daemon mode, waking every n (1) minutes.\n");
|
||||
fprintf(ErrFp, " -d... Debug: e=echo x=expr-eval t=trig v=dumpvars l=showline f=tracefiles\n");
|
||||
fprintf(ErrFp, " -e Divert messages normally sent to stderr to stdout\n");
|
||||
fprintf(ErrFp, " -b[n] Time format for cal: 0=am/pm, 1=24hr, 2=none\n");
|
||||
|
||||
@@ -390,12 +390,12 @@ DoThroughOmit(ParsePtr p, int ystart, int mstart, int dstart)
|
||||
{
|
||||
int yend = NO_YR, mend = NO_MON, dend = NO_DAY, r;
|
||||
int start, end, tmp;
|
||||
int parsing = 1;
|
||||
|
||||
Token tok;
|
||||
|
||||
DynamicBuffer buf;
|
||||
DBufInit(&buf);
|
||||
int parsing = 1;
|
||||
|
||||
while(parsing) {
|
||||
if ( (r=ParseToken(p, &buf)) ) return r;
|
||||
|
||||
@@ -772,7 +772,7 @@ void Init(int argc, char *argv[])
|
||||
case 'o':
|
||||
if (i == argc) Usage("Offset must be supplied");
|
||||
offset = atoi(argv[i++]);
|
||||
if (offset < 36) offset = 36;
|
||||
if (offset < 0) offset = 0;
|
||||
if (!*s) Usage("Offset must specify l, r, t or b");
|
||||
while(*s) {
|
||||
switch(*s++) {
|
||||
|
||||
@@ -426,7 +426,9 @@ int ComputeTrigger(int today, Trigger *trig, int *err, int save_in_globals)
|
||||
result;
|
||||
|
||||
trig->expired = 0;
|
||||
if (save_in_globals) LastTrigValid = 0;
|
||||
if (save_in_globals) {
|
||||
LastTrigValid = 0;
|
||||
}
|
||||
|
||||
/* Assume everything works */
|
||||
*err = OK;
|
||||
|
||||
@@ -68,7 +68,7 @@ echo "Sort Test" >> ../tests/test.out
|
||||
(echo "REM AT 12:00 MSG Untimed"; echo "REM MSG Timed") | ../src/remind -q -gaaad - 1 Jan 2000 >> ../tests/test.out 2>&1
|
||||
|
||||
echo "Purge Test" >> ../tests/test.out
|
||||
../src/remind -j999 ../tests/purge_dir/f1.rem >> ../tests/test.out 2>&1
|
||||
../src/remind -j999 ../tests/purge_dir/f1.rem 3 Feb 2012 >> ../tests/test.out 2>&1
|
||||
echo "F1" >> ../tests/test.out
|
||||
cat ../tests/purge_dir/f1.rem.purged >> ../tests/test.out
|
||||
echo "F2" >> ../tests/test.out
|
||||
@@ -81,7 +81,9 @@ rm -f ../tests/purge_dir/*.rem.purged >> ../tests/test.out 2>&1
|
||||
|
||||
../src/remind -p ../tests/shade.rem 1 August 2009 | ../src/rem2ps -e -l -c3 >> ../tests/test.out 2>&1
|
||||
|
||||
../src/remind -p12 ../tests/sun.rem 1 Jan 2011 >> ../tests/test.out 2>&1
|
||||
# The sun tests can fail due to math roundoff error changing the times
|
||||
# by a minute...
|
||||
# ../src/remind -p12 ../tests/sun.rem 1 Jan 2011 >> ../tests/test.out 2>&1
|
||||
|
||||
# Test -a vs -aa
|
||||
../src/remind -q -a - 1 Jan 2012 9:00 <<'EOF' >> ../tests/test.out 2>&1
|
||||
|
||||
1536
tests/test.cmp
1536
tests/test.cmp
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user