Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package remind for openSUSE:Factory checked in at 2024-08-03 20:04:52 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/remind (Old) and /work/SRC/openSUSE:Factory/.remind.new.7232 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "remind" Sat Aug 3 20:04:52 2024 rev:43 rq:1191246 version:5.0.2 Changes: -------- --- /work/SRC/openSUSE:Factory/remind/remind.changes 2024-06-17 19:33:56.840104957 +0200 +++ /work/SRC/openSUSE:Factory/.remind.new.7232/remind.changes 2024-08-03 20:05:06.128443875 +0200 @@ -1,0 +2,28 @@ +Fri Jul 26 17:00:43 UTC 2024 - Detlef Steuer <detlef.ste...@gmx.de> + +- VERSION 5.0 Patch 2 - 2024-07-26 + +* IMPROVEMENT: Remind: Revamp how ONCE works. You can now set a + special variable $OnceFile to be the path to a timestamp file. The + ONCE directive uses this timestamp file to track when it was last + run rather than the access date of the main reminder script. This + is more reliable because it doesn't rely on the atime of a file + (which might not be maintained accurately) and is not affected if + you edit your reminder script. + +* CHANGE: Taking input from stdin no longer implies the "-o" option; ONCE can + work if you set $OnceFile + +* CHANGE: Any of the -c, -n, -p and -s options implicitly enable the + -o option. As before, specifying a repeat factor *N or a date that + is not today on the command-line also implies -o. + +* MINOR NEW FEATURE: Rem2PDF: Add the "--svg" command-line option to produce + SVG output rather than PDF. + +* MINOR IMPROVEMENT: Remind: Improve the storage efficiency of short + string constants in compiled expression trees. + +* MINOR IMPROVEMENT: Remind: Remove some obsolete macro definitions + +------------------------------------------------------------------- Old: ---- remind-05.00.01.tar.gz New: ---- remind-05.00.02.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ remind.spec ++++++ --- /var/tmp/diff_new_pack.BYCYoB/_old 2024-08-03 20:05:06.700467376 +0200 +++ /var/tmp/diff_new_pack.BYCYoB/_new 2024-08-03 20:05:06.704467540 +0200 @@ -17,9 +17,9 @@ Name: remind -Version: 5.0.1 +Version: 5.0.2 Release: 0 -%define tar_version 05.00.01 +%define tar_version 05.00.02 Summary: A sophisticated calendar and alarm program License: GPL-2.0-only Group: Productivity/Office/Organizers ++++++ remind-05.00.01.tar.gz -> remind-05.00.02.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/configure new/remind-05.00.02/configure --- old/remind-05.00.01/configure 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/configure 2024-07-26 13:56:50.000000000 +0200 @@ -1,6 +1,6 @@ #! /bin/sh # Guess values for system-dependent variables and create Makefiles. -# Generated by GNU Autoconf 2.71 for remind 05.00.01. +# Generated by GNU Autoconf 2.71 for remind 05.00.02. # # # Copyright (C) 1992-1996, 1998-2017, 2020-2021 Free Software Foundation, @@ -608,8 +608,8 @@ # Identity of this package. PACKAGE_NAME='remind' PACKAGE_TARNAME='remind' -PACKAGE_VERSION='05.00.01' -PACKAGE_STRING='remind 05.00.01' +PACKAGE_VERSION='05.00.02' +PACKAGE_STRING='remind 05.00.02' PACKAGE_BUGREPORT='' PACKAGE_URL='https://dianne.skoll.ca/projects/remind/' @@ -1264,7 +1264,7 @@ # Omit some internal or obsolete options to make the list less imposing. # This message is too long to be a string in the A/UX 3.1 sh. cat <<_ACEOF -\`configure' configures remind 05.00.01 to adapt to many kinds of systems. +\`configure' configures remind 05.00.02 to adapt to many kinds of systems. Usage: $0 [OPTION]... [VAR=VALUE]... @@ -1326,7 +1326,7 @@ if test -n "$ac_init_help"; then case $ac_init_help in - short | recursive ) echo "Configuration of remind 05.00.01:";; + short | recursive ) echo "Configuration of remind 05.00.02:";; esac cat <<\_ACEOF @@ -1414,7 +1414,7 @@ test -n "$ac_init_help" && exit $ac_status if $ac_init_version; then cat <<\_ACEOF -remind configure 05.00.01 +remind configure 05.00.02 generated by GNU Autoconf 2.71 Copyright (C) 2021 Free Software Foundation, Inc. @@ -1864,7 +1864,7 @@ This file contains any messages produced by compilers while running configure, to aid debugging if configure makes a mistake. -It was created by remind $as_me 05.00.01, which was +It was created by remind $as_me 05.00.02, which was generated by GNU Autoconf 2.71. Invocation command line was $ $0$ac_configure_args_raw @@ -4703,7 +4703,7 @@ # report actual input values of CONFIG_FILES etc. instead of their # values after options handling. ac_log=" -This file was extended by remind $as_me 05.00.01, which was +This file was extended by remind $as_me 05.00.02, which was generated by GNU Autoconf 2.71. Invocation command line was CONFIG_FILES = $CONFIG_FILES @@ -4768,7 +4768,7 @@ cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1 ac_cs_config='$ac_cs_config_escaped' ac_cs_version="\\ -remind config.status 05.00.01 +remind config.status 05.00.02 configured by $0, generated by GNU Autoconf 2.71, with options \\"\$ac_cs_config\\" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/configure.in new/remind-05.00.02/configure.in --- old/remind-05.00.01/configure.in 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/configure.in 2024-07-26 13:56:50.000000000 +0200 @@ -1,6 +1,6 @@ dnl Process this file with autoconf to produce a configure script. -AC_INIT(remind, 05.00.01, , , https://dianne.skoll.ca/projects/remind/) +AC_INIT(remind, 05.00.02, , , https://dianne.skoll.ca/projects/remind/) AC_CONFIG_SRCDIR([src/queue.c]) cat <<'EOF' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/docs/WHATSNEW new/remind-05.00.02/docs/WHATSNEW --- old/remind-05.00.01/docs/WHATSNEW 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/docs/WHATSNEW 2024-07-26 13:56:50.000000000 +0200 @@ -1,5 +1,30 @@ CHANGES TO REMIND +* VERSION 5.0 Patch 2 - 2024-07-26 + +* IMPROVEMENT: Remind: Revamp how ONCE works. You can now set a + special variable $OnceFile to be the path to a timestamp file. The + ONCE directive uses this timestamp file to track when it was last + run rather than the access date of the main reminder script. This + is more reliable because it doesn't rely on the atime of a file + (which might not be maintained accurately) and is not affected if + you edit your reminder script. + +* CHANGE: Taking input from stdin no longer implies the "-o" option; ONCE can + work if you set $OnceFile + +* CHANGE: Any of the -c, -n, -p and -s options implicitly enable the + -o option. As before, specifying a repeat factor *N or a date that + is not today on the command-line also implies -o. + +* MINOR NEW FEATURE: Rem2PDF: Add the "--svg" command-line option to produce + SVG output rather than PDF. + +* MINOR IMPROVEMENT: Remind: Improve the storage efficiency of short + string constants in compiled expression trees. + +* MINOR IMPROVEMENT: Remind: Remove some obsolete macro definitions + * VERSION 5.0 Patch 1 - 2024-06-08 * MINOR IMPROVEMENT: Add short-circuit evaluation to the isany() function, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/man/remind.1.in new/remind-05.00.02/man/remind.1.in --- old/remind-05.00.01/man/remind.1.in 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/man/remind.1.in 2024-07-26 13:56:50.000000000 +0200 @@ -11,8 +11,8 @@ a program to be executed. .PP If \fIfilename\fR is specified as a single dash '-', then \fBRemind\fR -takes its input from standard input. This also implicitly enables -the \fB\-o\fR option, described below. +takes its input from standard input. + .PP If \fIfilename\fR happens to be a directory rather than a plain file, then \fBRemind\fR reads all of @@ -32,7 +32,8 @@ The \fB\-n\fR option causes \fBRemind\fR to print the \fBnext\fR occurrence of each reminder in a simple calendar format. You can sort this by date by piping the output through \fBsort(1)\fR. Note that the \fB\-n\fR -option causes any \fB\-g\fR option to be \fIignored\fR. +option causes any \fB\-g\fR option to be \fIignored\fR and also implicitly +enables the \fB\-o\fR option. .TP .B \-j\fR[\fIn\fR] Runs \fBRemind\fR in "purge" mode to get rid of expired reminders. @@ -47,7 +48,7 @@ sent to standard output. If you supply a number \fIn\fR, then a calendar will be generated for \fIn\fR months, starting with the current month. By default, a calendar for only the current month is -produced. +produced. This option implicitly enables the \fB\-o\fR option. .RS .PP You can precede \fIn\fR (if any) with a set of flags. The flags @@ -173,7 +174,7 @@ that the output calendar is not formatted. It is listed in a "simple format" that can be used as input for more sophisticated calendar-drawing programs. If \fIn\fR starts with "+", then it is interpreted as a number -of weeks. +of weeks. This option also implicitly enables the \fB\-o\fR option. If you immediately follow the \fBs\fR with the letter \fBa\fR, then \fBRemind\fR displays reminders on the calendar on the @@ -200,6 +201,9 @@ is disabled and the %"...%" sequences are preserved in the output. .RS .PP +The \fB\-p\fR, \fB\-pp\fR and \fB\-ppp\fR options implicitly enable +the \fB\-o\fR option. +.PP Note that the \fB\-pp\fR or \fB\-ppp\fR options also enable the \fB\-l\fR option. .RE @@ -223,7 +227,11 @@ $RunOff system variable. .TP .B \-o -The \fB\-o\fR option causes \fBRemind\fR to ignore all \fBONCE\fR directives. +The \fB\-o\fR option causes \fBRemind\fR to ignore all \fBONCE\fR +directives. Note that \fBONCE\fR is also ignored if any of the +\fB\-c\fR, \fB\-n\fR, \fB\-p\fR, or \fB\-s\fR options is used, if a +repetition factor \fB*n\fR is used, or if a date other than today's +date is specified on the command-line. .TP .B \-t The \fB\-t\fR option causes \fBRemind\fR to trigger all non-expired reminders, @@ -1019,26 +1027,35 @@ .B THE ONCE KEYWORD .PP Sometimes, it is necessary to ensure that reminders are run only once -on a given day. For example, if you have a reminder that makes a backup -of your files every Friday: +on a given day. For example, compare the following two reminders: .PP .nf - REM Fri RUN do_backup + REM Fri RUN do_backup + REM Fri ONCE RUN do_backup .fi .PP -(Here, \fIdo_backup\fR is assumed to be a program or shell script that -does the work.) If you run \fBRemind\fR from your .login script, for -example, and log in several times per day, the \fIdo_backup\fR program -will be run each time you log in. If, however, you use the \fBONCE\fR -keyword in the reminder, the \fBRemind\fR checks the last access date of -the reminder script. If it is the same as the current date, \fBRemind\fR -assumes that it has already been run, and will not issue reminders containing -the \fBONCE\fR keyword. +The first will be run every time you invoke \fBRemind\fR on a Friday, +whereas the second will be run only the first time you invoke +\fBRemind\fR on a given Friday. +.PP +If you run \fBRemind\fR from your .login script, for example, and log +in several times per day, the \fIdo_backup\fR program in the first +reminder will be run each time you log in. If, however, you use the +\fBONCE\fR keyword in the reminder, the \fBRemind\fR checks the last +access date of the reminder script. If it is the same as the current +date, \fBRemind\fR assumes that it has already been run, and will not +issue reminders containing the \fBONCE\fR keyword. .PP Note that if you view or edit your reminder script, the last access date will be updated, and the \fBONCE\fR keyword will not operate properly. +You can fix this by setting a timestamp file for \fBRemind\fR to track +the last-run date; see the documentation of \fB$OnceFile\fR in the +\fBSYSTEM VARIABLES\fR section. If you use standard input as your +\fBRemind\fR input file, then you \fImust\fR use \B$OnceFile\fR for the +\fBONCE\fR keyword to work properly. +.PP If you start \fBRemind\fR with the \fB\-o\fR option, then the \fBONCE\fR -keyword will be ignored. +keyword will be ignored and any \fB$OnceFile\fR will be ignored. .PP .B LOCALLY OMITTING WEEKDAYS .PP @@ -2532,9 +2549,9 @@ If non-zero, then the \fB\-h\fR option was supplied on the command line. .TP .B $IgnoreOnce (read-only) -If non-zero, then the \fB\-o\fR option was supplied on the command line, -or a date different from today's true date was supplied. If non-zero, -then \fBONCE\fR directives will be ignored. +If non-zero, then the \fB\-o\fR option was supplied on the command +line, or implicitly enabled for some other reason. In this case, +\fBONCE\fR directives will be ignored. .TP .B $InfDelta (read-only) If non-zero, then the \fB\-t\fR option was supplied on the command line, @@ -2691,6 +2708,20 @@ not affect it. .RE .TP +.B $OnceFile (STRING type) +If you set this variable to a non-empty string, then rather than using +the file access date to determine whether or not to run a ONCE-type +reminder, \fBRemind\fR will maintain a timestamp in the file \fB$OnceFile\fR. +This is more reliable than using the access date of the reminder file. +.RS +.PP +If \fB$OnceFile\fR does not exist, then it will be created the first time +a \fBONCE\fR keyword is processed. The file must be writable by the +current user. If you try to set \fB$OnceFile\fR \fIafter\fR a \fBONCE\fR +reminder has already been processed, \fBRemind\fR will issue a warning +and ignore the attempt to set \fB$OnceFile\fR. +.RE +.TP .B $ParseUntriggered A flag indicating whether or not \fBRemind\fR should fully parse \fBREM\fR statements that are not triggered. 0 means to skip parsing them and 1 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/rem2pdf/bin/rem2pdf.in new/remind-05.00.02/rem2pdf/bin/rem2pdf.in --- old/remind-05.00.01/rem2pdf/bin/rem2pdf.in 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/rem2pdf/bin/rem2pdf.in 2024-07-26 13:56:50.000000000 +0200 @@ -60,7 +60,7 @@ margin_bottom => 36, margin_left => 36, margin_right => 36, - + svg => 0, verbose => 0, }; @@ -80,6 +80,7 @@ --landscape, -l Print in landscape orientation --small-calendars=N Choose location for small calendars +--svg Output SVG instead of PDF -cN Synonym for --small-calendars=N --left-numbers, -x Print day numbers on the left --fill-page, -e Fill the entire page @@ -112,6 +113,7 @@ my $ret = GetOptions('landscape|l' => \$settings->{landscape}, 'small-calendars|c=i' => \$settings->{small_calendars}, 'left-numbers|x' => \$settings->{numbers_on_left}, + 'svg' => \$settings->{svg}, 'fill-page|e' => \$settings->{fill_entire_page}, 'media|m=s' => \$settings->{media}, 'width|w=i' => \$settings->{width}, @@ -187,8 +189,14 @@ my $errored_out = 0; -my $surface = Cairo::PdfSurface->create_for_stream(sub { print $_[1] unless $errored_out; }, undef, - $settings->{width}, $settings->{height}); +my $surface; +if ($settings->{svg}) { + $surface = Cairo::SvgSurface->create_for_stream(sub { print $_[1] unless $errored_out; }, undef, + $settings->{width}, $settings->{height}); +} else { + $surface = Cairo::PdfSurface->create_for_stream(sub { print $_[1] unless $errored_out; }, undef, + $settings->{width}, $settings->{height}); +} # set_metadata not available in older versions of Cairo eval { $surface->set_metadata('title', 'Calendar'); }; @@ -199,6 +207,7 @@ my $cr = Cairo::Context->create($surface); $cr->set_line_width($settings->{line_thickness}); +my $warned = 0; while(1) { my ($obj, $err) = Remind::PDF->create_from_stream(*STDIN, {color => 1, @@ -215,8 +224,15 @@ } last; } - $done_one = 1; + if ($settings->{svg} && $done_one) { + if (!$warned) { + print STDERR "WARNING: --svg can only output one page; ignoring subsequent\nmonths in a multi-month calendar.\n"; + $warned = 1; + } + next; + } $obj->render($cr, $settings); + $done_one = 1; } $surface->finish(); @@ -273,17 +289,18 @@ =head1 NAME -rem2pdf - draw a PDF calendar from Remind output +rem2pdf - draw a PDF or SVG calendar from Remind output =head1 SYNOPSIS remind -pp [options] file | rem2pdf [options] > output.pdf + remind -pp [options] file | rem2pdf --svg [options] > output.svg =head1 DESCRIPTION B<rem2pdf> reads the standard input, which should be the results of running B<remind> with the B<-p>, B<-pp> or B<-ppp> options. It emits -PDF code that draws a calendar to standard output. +PDF or SVG code that draws a calendar to standard output. B<rem2pdf> uses the Pango text formatting library (L<https://pango.gnome.org/>) and the Cairo graphics library (L<https://www.cairographics.org/>) to produce @@ -298,6 +315,12 @@ =over +=item --svg + +Output SVG instead of PDF. In this case, you should feed C<rem2pdf> +only one month's worth of calendar data, because it cannot create +a multi-page SVG file. + =item --landscape, -l Print the calendar in landscape orientation. Essentially, this swaps diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/rem2pdf/lib/Remind/PDF.pm new/remind-05.00.02/rem2pdf/lib/Remind/PDF.pm --- old/remind-05.00.01/rem2pdf/lib/Remind/PDF.pm 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/rem2pdf/lib/Remind/PDF.pm 2024-07-26 13:56:50.000000000 +0200 @@ -1008,7 +1008,17 @@ sub render { my ($self, $cr, $settings) = @_; + my $done = 0; + my $warned = 0; foreach my $e (@{$self->{entries}}) { + if ($settings->{svg} && $done) { + if (!$warned) { + print STDERR "WARNING: --svg can only output one page; ignoring subsequent\nmonths in a multi-month calendar.\n"; + $warned = 1; + } + next; + } + $done = 1; $e->render($cr, $settings); } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/custom.h new/remind-05.00.02/src/custom.h --- old/remind-05.00.01/src/custom.h 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/custom.h 2024-07-26 13:56:50.000000000 +0200 @@ -20,7 +20,7 @@ /* western hemisphere. */ /* */ /* The default values are initially set to the city hall in Ottawa, */ -/* Ontario, Canada. */ +/* Ontario, Canada. */ /*---------------------------------------------------------------------*/ #define DEFAULT_LATITUDE 45.420556 #define DEFAULT_LONGITUDE -75.689722 @@ -69,12 +69,6 @@ /**********************************************************************/ /*---------------------------------------------------------------------*/ -/* WANT_SHELL_ESCAPING: Define this if you want special shell */ -/* characters to be escaped with a backslash for the -k option. */ -/*---------------------------------------------------------------------*/ -#define WANT_SHELL_ESCAPING 1 - -/*---------------------------------------------------------------------*/ /* BASE: The base year for date calculation. NOTE! January 1 of the */ /* base year MUST be a Monday, else Remind will not work! */ /* IMPORTANT NOTE: The Hebrew date routines depend on BASE */ @@ -110,16 +104,6 @@ #define MAX_STR_LEN 65535 /*---------------------------------------------------------------------*/ -/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */ -/*---------------------------------------------------------------------*/ -#define OP_STACK_SIZE 100 - -/*---------------------------------------------------------------------*/ -/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */ -/*---------------------------------------------------------------------*/ -#define VAL_STACK_SIZE 100 - -/*---------------------------------------------------------------------*/ /* INCLUDE_NEST: How many nested INCLUDES do we handle? */ /*---------------------------------------------------------------------*/ #define INCLUDE_NEST 9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/custom.h.in new/remind-05.00.02/src/custom.h.in --- old/remind-05.00.01/src/custom.h.in 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/custom.h.in 2024-07-26 13:56:50.000000000 +0200 @@ -20,7 +20,7 @@ /* western hemisphere. */ /* */ /* The default values are initially set to the city hall in Ottawa, */ -/* Ontario, Canada. */ +/* Ontario, Canada. */ /*---------------------------------------------------------------------*/ #define DEFAULT_LATITUDE 45.420556 #define DEFAULT_LONGITUDE -75.689722 @@ -69,12 +69,6 @@ /**********************************************************************/ /*---------------------------------------------------------------------*/ -/* WANT_SHELL_ESCAPING: Define this if you want special shell */ -/* characters to be escaped with a backslash for the -k option. */ -/*---------------------------------------------------------------------*/ -#define WANT_SHELL_ESCAPING 1 - -/*---------------------------------------------------------------------*/ /* BASE: The base year for date calculation. NOTE! January 1 of the */ /* base year MUST be a Monday, else Remind will not work! */ /* IMPORTANT NOTE: The Hebrew date routines depend on BASE */ @@ -110,16 +104,6 @@ #define MAX_STR_LEN 65535 /*---------------------------------------------------------------------*/ -/* OP_STACK_SIZE: The size of the operator stack for expr. parsing */ -/*---------------------------------------------------------------------*/ -#define OP_STACK_SIZE 100 - -/*---------------------------------------------------------------------*/ -/* VAL_STACK_SIZE: The size of the operand stack for expr. parsing */ -/*---------------------------------------------------------------------*/ -#define VAL_STACK_SIZE 100 - -/*---------------------------------------------------------------------*/ /* INCLUDE_NEST: How many nested INCLUDES do we handle? */ /*---------------------------------------------------------------------*/ #define INCLUDE_NEST 9 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/dorem.c new/remind-05.00.02/src/dorem.c --- old/remind-05.00.01/src/dorem.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/dorem.c 2024-07-26 13:56:50.000000000 +0200 @@ -182,7 +182,7 @@ if (dse == DSEToday && !(!IgnoreOnce && trig.once != NO_ONCE && - FileAccessDate == DSEToday)) + GetOnceDate() == DSEToday)) QueueReminder(p, &trig, &tim, trig.sched); /* If we're in daemon mode, do nothing over here */ if (Daemon) { @@ -1191,7 +1191,7 @@ *err = 0; /* Handle the ONCE modifier in the reminder. */ - if (!IgnoreOnce && t->once !=NO_ONCE && FileAccessDate == DSEToday) + if (!IgnoreOnce && t->once !=NO_ONCE && GetOnceDate() == DSEToday) return 0; if (dse < DSEToday) return 0; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/dosubst.c new/remind-05.00.02/src/dosubst.c --- old/remind-05.00.01/src/dosubst.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/dosubst.c 2024-07-26 13:56:50.000000000 +0200 @@ -13,7 +13,6 @@ #include "config.h" #include "types.h" -#define L_IN_DOSUBST #include <stdio.h> #include <string.h> #include <ctype.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/expr.c new/remind-05.00.02/src/expr.c --- old/remind-05.00.01/src/expr.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/expr.c 2024-07-26 13:56:50.000000000 +0200 @@ -39,6 +39,7 @@ 6) N_USER_FUNC: A reference to a user-defined function 7) N_OPERATOR: A reference to an operator such as "+" or "&&" 8) N_ERROR: A node resulting from a parse error + 9) N_SHORT_STR: A string constant short enough to store in u.name Additional types are N_SHORT_VAR, N_SHORT_SYSVAR, and N_SHORT_USER_FUNC which behave identically to N_VARIABLE, N_SYSVAR and N_USER_FUNC @@ -167,8 +168,8 @@ #define STACK_ARGS_MAX 5 /* Maximum parse level before we bail (to avoid SEGV from filling stack)*/ - #define MAX_PARSE_LEVEL 2000 + static int parse_level_high_water = 0; #define CHECK_PARSE_LEVEL() do { if (level > parse_level_high_water) { parse_level_high_water = level; if (level > MAX_PARSE_LEVEL) { *r = E_OP_STK_OVER; return NULL; } } } while(0) @@ -198,7 +199,6 @@ /* How many expr_node objects to allocate at a time */ #define ALLOC_CHUNK 64 - /***************************************************************/ /* */ /* alloc_expr_node - allocate an expr_node object */ @@ -585,7 +585,7 @@ /* eval_userfunc - evaluate a user-defined function */ /* */ /* This function sets up a local value array by evaluating */ -/* all of its children, and then evaluated the expr_node */ +/* all of its children, and then evaluates the expr_node */ /* tree associated with the user-defined function. */ /* */ /***************************************************************/ @@ -736,6 +736,19 @@ return r; } +static int CopyShortStr(Value *ans, expr_node *node) +{ + size_t len = strlen(node->u.name); + ans->v.str = malloc(len+1); + if (!ans->v.str) { + ans->type = ERR_TYPE; + return E_NO_MEM; + } + strcpy(ans->v.str, node->u.name); + ans->type = STR_TYPE; + return OK; +} + /***************************************************************/ /* */ /* evaluate_expr_node - evaluate an expression */ @@ -776,6 +789,9 @@ ans->type = ERR_TYPE; return E_SWERR; + case N_SHORT_STR: + return CopyShortStr(ans, node); + case N_CONSTANT: /* Constant node? Just return a copy of the constant */ return CopyValue(ans, &(node->u.value)); @@ -1873,6 +1889,7 @@ size_t len; char const *s = DBufValue(&ExprBuf); atom->u.value.type = ERR_TYPE; + atom->type = N_CONSTANT; if (!*s) { Eprint("%s", ErrMsg[E_EOLN]); @@ -1881,6 +1898,12 @@ ampm = 0; if (*s == '\"') { /* It's a literal string "*/ len = strlen(s)-1; + if (len <= SHORT_NAME_BUF) { + atom->type = N_SHORT_STR; + strncpy(atom->u.name, s+1, len-1); + atom->u.name[len-1] = 0; + return OK; + } atom->u.value.type = STR_TYPE; atom->u.value.v.str = malloc(len); if (! atom->u.value.v.str) { @@ -2016,9 +2039,7 @@ /* Constant */ r = set_constant_value(atom); - if (r == OK) { - atom->type = N_CONSTANT; - } else { + if (r != OK) { atom->type = N_ERROR; } return r; @@ -2560,6 +2581,9 @@ case N_CONSTANT: PrintValue(&(node->u.value), fp); return; + case N_SHORT_STR: + fprintf(fp, "\"%s\"", node->u.name); + return; case N_SHORT_VAR: fprintf(fp, "%s", node->u.name); return; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/globals.h new/remind-05.00.02/src/globals.h --- old/remind-05.00.01/src/globals.h 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/globals.h 2024-07-26 13:56:50.000000000 +0200 @@ -78,9 +78,12 @@ EXTERN INIT( int ExpressionEvaluationTimeLimit, 0); EXTERN INIT( volatile sig_atomic_t ExpressionTimeLimitExceeded, 0); EXTERN INIT( int IgnoreOnce, 0); -EXTERN INIT( int SortByTime, 0); -EXTERN INIT( int SortByDate, 0); -EXTERN INIT( int SortByPrio, 0); +EXTERN INIT( char const *OnceFile, NULL); +EXTERN INIT( int OnceDate, -1); +EXTERN INIT( int ProcessedOnce, 0); +EXTERN INIT( int SortByTime, SORT_NONE); +EXTERN INIT( int SortByDate, SORT_NONE); +EXTERN INIT( int SortByPrio, SORT_NONE); EXTERN INIT( int UntimedBeforeTimed, 0); EXTERN INIT( int DefaultPrio, NO_PRIORITY); EXTERN INIT( int SysTime, -1); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/init.c new/remind-05.00.02/src/init.c --- old/remind-05.00.01/src/init.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/init.c 2024-07-26 13:56:50.000000000 +0200 @@ -241,7 +241,6 @@ arg++; if (!*arg) { UseStdin = 1; - IgnoreOnce = 1; i--; break; } @@ -324,6 +323,7 @@ NextMode = 1; DontQueue = 1; Daemon = 0; + IgnoreOnce = 1; break; case 'r': @@ -457,6 +457,7 @@ break; case 'c': case 'C': + IgnoreOnce = 1; DoCalendar = 1; weeks = 0; /* Parse the flags */ @@ -501,6 +502,7 @@ case 's': case 'S': DoSimpleCalendar = 1; + IgnoreOnce = 1; weeks = 0; while(*arg) { if (*arg == 'a' || *arg == 'A') { @@ -527,6 +529,7 @@ case 'p': case 'P': DoSimpleCalendar = 1; + IgnoreOnce = 1; PsCal = PSCAL_LEVEL1; while (*arg == 'a' || *arg == 'A' || *arg == 'q' || *arg == 'Q' || @@ -720,6 +723,7 @@ if (rep > 0) { Iterations = rep; + IgnoreOnce = 1; DontQueue = 1; Daemon = 0; } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/main.c new/remind-05.00.02/src/main.c --- old/remind-05.00.01/src/main.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/main.c 2024-07-26 13:56:50.000000000 +0200 @@ -240,7 +240,8 @@ if (!UseStdin) { FileAccessDate = GetAccessDate(InitialFile); } else { - FileAccessDate = DSEToday; + FileAccessDate = DSEToday - 1; + if (FileAccessDate < 0) FileAccessDate = 0; } if (FileAccessDate < 0) { @@ -1891,3 +1892,40 @@ if (DynamicMonthName[mon]) return DynamicMonthName[mon]; return MonthName[mon]; } + +static int GetOnceDateFromFile(void) +{ + FILE *fp; + + int once_date = 0; + + fp = fopen(OnceFile, "r"); + if (fp) { + if (fscanf(fp, "%d", &once_date) != 1) { + once_date = 0; + } + fclose(fp); + } + /* Save today to file */ + fp = fopen(OnceFile, "w"); + if (!fp) { + Wprint("Warning: Unable to save ONCE timestamp to %s: %s", + OnceFile, strerror(errno)); + return once_date; + } + fprintf(fp, "%d\n# This is a timestamp file used by Remind to track ONCE reminders.\n# Do not edit or delete it.\n", DSEToday); + fclose(fp); + return once_date; +} + +int GetOnceDate(void) +{ + ProcessedOnce = 1; + if (IgnoreOnce || !OnceFile || !*OnceFile) { + return FileAccessDate; + } + if (OnceDate < 0) { + OnceDate = GetOnceDateFromFile(); + } + return OnceDate; +} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/moon.c new/remind-05.00.02/src/moon.c --- old/remind-05.00.01/src/moon.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/moon.c 2024-07-26 13:56:50.000000000 +0200 @@ -100,21 +100,12 @@ #define mmlong 64.975464 /* Moon's mean lonigitude at the epoch */ #define mmlongp 349.383063 /* Mean longitude of the perigee at the epoch */ -#define mlnode 151.950429 /* Mean longitude of the node at the - epoch */ -#define minc 5.145396 /* Inclination of the Moon's orbit */ #define mecc 0.054900 /* Eccentricity of the Moon's orbit */ #define mangsiz 0.5181 /* Moon's angular size at distance a from Earth */ #define msmax 384401.0 /* Semi-major axis of Moon's orbit in km */ -#define mparallax 0.9507 /* Parallax at distance a from Earth */ #define synmonth 29.53058868 /* Synodic month (new Moon to new Moon) */ -#define lunatbase 2423436.0 /* Base date for E. W. Brown's numbered - series of lunations (1923 January 16) */ - -/* Properties of the Earth */ -#define earthrad 6378.16 /* Radius of Earth in kilometres */ #ifdef PI #undef PI #endif @@ -123,11 +114,6 @@ /* Handy mathematical functions */ -#ifdef sgn -#undef sgn -#endif -#define sgn(x) (((x) < 0) ? -1 : ((x) > 0 ? 1 : 0)) /* Extract sign */ - #ifdef abs #undef abs #endif diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/protos.h new/remind-05.00.02/src/protos.h --- old/remind-05.00.01/src/protos.h 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/protos.h 2024-07-26 13:56:50.000000000 +0200 @@ -225,6 +225,7 @@ void FixSpecialType(Trigger *trig); void WriteJSONTrigger(Trigger const *t, int include_tags, int today); void WriteJSONTimeTrigger(TimeTrig const *tt); +int GetOnceDate(void); #ifdef REM_USE_WCHAR #define _XOPEN_SOURCE 600 #include <wctype.h> diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/types.h new/remind-05.00.02/src/types.h --- old/remind-05.00.01/src/types.h 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/types.h 2024-07-26 13:56:50.000000000 +0200 @@ -44,6 +44,7 @@ N_FREE, N_ERROR, N_CONSTANT, + N_SHORT_STR, N_LOCAL_VAR, N_SHORT_VAR, N_VARIABLE, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/userfns.c new/remind-05.00.02/src/userfns.c --- old/remind-05.00.01/src/userfns.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/userfns.c 2024-07-26 13:56:50.000000000 +0200 @@ -115,17 +115,6 @@ } orig_namelen = buf.len; - /* Should be followed by '(' */ - c = ParseNonSpaceChar(p, &r, 0); - if (r) { - DBufFree(&buf); - return r; - } - if (c != '(') { - DBufFree(&buf); - return E_PARSE_ERR; - } - /* Convert to lower-case */ strtolower(DBufValue(&buf)); @@ -141,6 +130,18 @@ return OK; } } + + /* Should be followed by '(' */ + c = ParseNonSpaceChar(p, &r, 0); + if (r) { + DBufFree(&buf); + return r; + } + if (c != '(') { + DBufFree(&buf); + return E_PARSE_ERR; + } + func = NEW(UserFunc); if (!func) { DBufFree(&buf); diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/src/var.c new/remind-05.00.02/src/var.c --- old/remind-05.00.01/src/var.c 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/src/var.c 2024-07-26 13:56:50.000000000 +0200 @@ -164,6 +164,40 @@ return latitude_longitude_func(do_set, val, &Latitude, -90.0, 90.0); } +static int oncefile_func(int do_set, Value *val) +{ + if (do_set) { + if (val->type != STR_TYPE) return E_BAD_TYPE; + if (! (*val->v.str) && (!OnceFile || !*OnceFile)) { + /* Trying to set already-empty string to empty string */ + return OK; + } + if (OnceFile && !strcmp(OnceFile, val->v.str)) { + /* Trying to set to the exact same value */ + return OK; + } + + if (ProcessedOnce) { + Wprint("Not setting $OnceFile: Already processed a reminder with a ONCE clause"); + return OK; + } + if (OnceFile) { + free( (void *) OnceFile); + } + OnceFile = StrDup(val->v.str); + if (!OnceFile) return E_NO_MEM; + return OK; + } + if (!OnceFile) { + val->v.str = StrDup(""); + } else { + val->v.str = StrDup(OnceFile); + } + if (!val->v.str) return E_NO_MEM; + val->type = STR_TYPE; + return OK; + +} static int terminal_bg_func(int do_set, Value *val) { UNUSED(do_set); @@ -883,6 +917,7 @@ {"NumTrig", 0, INT_TYPE, &NumTriggered, 0, 0 }, {"October", 1, STR_TYPE, &DynamicMonthName[9], 0, 0 }, {"On", 1, STR_TYPE, &DynamicOn, 0, 0 }, + {"OnceFile", 1, SPECIAL_TYPE, oncefile_func, 0, 0 }, {"ParseUntriggered", 1, INT_TYPE, &ParseUntriggered, 0, 1 }, {"Pm", 1, STR_TYPE, &DynamicPm, 0, 0 }, {"PrefixLineNo", 0, INT_TYPE, &DoPrefixLineNo, 0, 0 }, diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/tests/test-once.rem new/remind-05.00.02/tests/test-once.rem --- old/remind-05.00.01/tests/test-once.rem 1970-01-01 01:00:00.000000000 +0100 +++ new/remind-05.00.02/tests/test-once.rem 2024-07-26 13:56:50.000000000 +0200 @@ -0,0 +1,7 @@ +BANNER % +SET $OnceFile "../tests/once.timestamp" + +REM ONCE MSG This should only be issued once per day. + +SET $OnceFile "../tests/once.timestamp" +SET $OnceFile "../tests/once-again.timestamp" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/tests/test-rem new/remind-05.00.02/tests/test-rem --- old/remind-05.00.01/tests/test-rem 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/tests/test-rem 2024-07-26 13:56:50.000000000 +0200 @@ -569,6 +569,20 @@ ../src/remind ../tests/if1.rem 2020-03-03 >> ../tests/test.out 2>&1 +# Test ONCE with a timestamp file +rm -f ../tests/once.timestamp +../src/remind ../tests/test-once.rem >> ../tests/test.out 2>&1 +../src/remind ../tests/test-once.rem >> ../tests/test.out 2>&1 +../src/remind ../tests/test-once.rem >> ../tests/test.out 2>&1 +tail +2 ../tests/once.timestamp >> ../tests/test.out 2>&1 +rm -f ../tests/once.timestamp + +../src/remind - < ../tests/test-once.rem >> ../tests/test.out 2>&1 +../src/remind - < ../tests/test-once.rem >> ../tests/test.out 2>&1 +../src/remind - < ../tests/test-once.rem >> ../tests/test.out 2>&1 +tail +2 ../tests/once.timestamp >> ../tests/test.out 2>&1 +rm -f ../tests/once.timestamp + # Remove references to SysInclude, which is build-specific grep -F -v '$SysInclude' < ../tests/test.out > ../tests/test.out.1 && mv -f ../tests/test.out.1 ../tests/test.out cmp -s ../tests/test.out ../tests/test.cmp diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/remind-05.00.01/tests/test.cmp new/remind-05.00.02/tests/test.cmp --- old/remind-05.00.01/tests/test.cmp 2024-06-08 16:57:38.000000000 +0200 +++ new/remind-05.00.02/tests/test.cmp 2024-07-26 13:56:50.000000000 +0200 @@ -1023,7 +1023,7 @@ "a05" + "6" => "a056" value("a056") => "SDFJHSDF KSJDFH KJSDFH KSJDFH" set a058 version() -version() => "05.00.01" +version() => "05.00.02" set a059 wkday(today()) today() => 1991-02-16 wkday(1991-02-16) => "Saturday" @@ -2612,7 +2612,7 @@ a109 2012-01-01 a128 2018-02-03@16:45 a039 "February" -a058 "05.00.01" +a058 "05.00.02" a077 "1992 92\n" a096 -4 a119 -1 @@ -2778,6 +2778,7 @@ $NumTrig 41 $October "October" $On "on" + $OnceFile "" $ParseUntriggered 1 [0, 1] $Pm "pm" $PrefixLineNo 0 @@ -11806,7 +11807,7 @@ Error reading include_dir/ww: Can't open file SECURITY: Won't read world-writable file or directory! Error reading include_dir/ww: No files matching *.rem -05.00.01 +05.00.02 NOTE JSONQUEUE [{"priority":2,"eventstart":"VOLATILE","time":"23:59","nexttime":"23:59","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue2.rem","lineno":1,"type":"MSG_TYPE","body":"XXXX"},{"priority":999,"eventstart":"VOLATILE","time":"23:58","nexttime":"23:58","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":5,"type":"MSG_TYPE","body":"quux"},{"priority":42,"eventstart":"VOLATILE","time":"23:57","nexttime":"23:57","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":4,"type":"MSG_TYPE","body":"bar"},{"priority":5000,"eventstart":"VOLATILE","time":"23:56","nexttime":"23:56","tdelta":0,"trep":0,"rundisabled":0,"ntrig":1,"filename":"../tests/queue1.rem","lineno":3,"type":"MSG_TYPE","body":"foo"}] NOTE ENDJSONQUEUE @@ -12369,3 +12370,21 @@ ../tests/if1.rem(5): Warning: Missing ENDIF ../tests/if1.rem(3): IF without ENDIF No reminders. +../tests/test-once.rem(7): Not setting $OnceFile: Already processed a reminder with a ONCE clause +This should only be issued once per day. + +../tests/test-once.rem(7): Not setting $OnceFile: Already processed a reminder with a ONCE clause +No reminders. +../tests/test-once.rem(7): Not setting $OnceFile: Already processed a reminder with a ONCE clause +No reminders. +# This is a timestamp file used by Remind to track ONCE reminders. +# Do not edit or delete it. +-stdin-(7): Not setting $OnceFile: Already processed a reminder with a ONCE clause +This should only be issued once per day. + +-stdin-(7): Not setting $OnceFile: Already processed a reminder with a ONCE clause +No reminders. +-stdin-(7): Not setting $OnceFile: Already processed a reminder with a ONCE clause +No reminders. +# This is a timestamp file used by Remind to track ONCE reminders. +# Do not edit or delete it.