Package: at
Version: 3.1.10.2

On Thursday `at 23:55 Fri' will schedule the job "tomorrow" (that's okay).
But on Friday `at 23:55 Fri' will schedule the job on Friday _in a
week's time_ (ie. *not* "today").  IMO this is wrong, and not in line
with other established implementations:

http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cron/
in particular:
http://src.opensolaris.org/source/xref/onnv/onnv-gate/usr/src/cmd/cron/att1.y
l. 170+ (*tp is current time, rt will be added to at)

http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/at/
in particular:
http://www.openbsd.org/cgi-bin/cvsweb/src/usr.bin/at/parsetime.c?annotate=1.17
l. 516+

FWIW, `date -d Fri' executed on Friday will choose "today".



I would suggest the following change:

diff -ur orig.at-3.1.12/at.c at-3.1.12/at.c
diff -ur orig.at-3.1.12/parsetime.y at-3.1.12/parsetime.y
--- orig.at-3.1.12/parsetime.y  2009-11-23 16:11:52.000000000 +0100
+++ at-3.1.12/parsetime.y       2010-04-07 23:32:06.000000000 +0200
@@ -178,7 +178,7 @@
                 | month_name day_number ',' year_number
                 | day_of_week
                   {
-                      add_date ((6 + $1 - exectm.tm_wday) %7 + 1, DAY);
+                      add_date ((7 + $1 - exectm.tm_wday) %7, DAY);
                   }
                 | TODAY
                 | TOMORROW


Note: I have left `NEXT day_of_week' intact, ie. executing `at next Fri'
on Friday I tend to think seven days later, not this Friday (`date -d'
seems to disagree, though).


Regards,
Stan



-- 
To UNSUBSCRIBE, email to debian-bugs-dist-requ...@lists.debian.org
with a subject of "unsubscribe". Trouble? Contact listmas...@lists.debian.org

Reply via email to