diff options
author | Dale Mellor <mcron-lsfnyl@rdmp.org> | 2020-04-13 11:42:39 +0100 |
---|---|---|
committer | Dale Mellor <mcron-lsfnyl@rdmp.org> | 2020-04-20 17:03:25 +0000 |
commit | 1eedf3b6d24f421ccdb8798b053ee718d1051651 (patch) | |
tree | 9008b15f214aaa993f67fa4cd92f099b1bdc4a45 /src/mcron/job-specifier.scm | |
parent | 4a05a2e8612560cd7f3274d2930e86bfc9f1ec93 (diff) | |
download | mcron-1eedf3b6d24f421ccdb8798b053ee718d1051651.tar.gz mcron-1eedf3b6d24f421ccdb8798b053ee718d1051651.tar.bz2 mcron-1eedf3b6d24f421ccdb8798b053ee718d1051651.zip |
project: banish need for C compiler
This patch gets rid of the thin veneer that we currently have around the three
executables. This was done for historical reasons (circa 2003 Guile couldnʼt
deal with process signals and forks). In fact these problems were fixed many
moons ago, and there is now no need for it. The project becomes 100% Guile!
Many files are affected; interested coders should use the GIT repository to
understand the details of all the changes.
Diffstat (limited to 'src/mcron/job-specifier.scm')
-rw-r--r-- | src/mcron/job-specifier.scm | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/src/mcron/job-specifier.scm b/src/mcron/job-specifier.scm index 120bf99..7eb2304 100644 --- a/src/mcron/job-specifier.scm +++ b/src/mcron/job-specifier.scm @@ -202,14 +202,14 @@ go into the list. For example, (range 1 6 2) returns '(1 3 5)." ;; The job function, available to configuration files for adding a job rule to ;; the system. ;; -;; Here we must 'normalize' the next-time-function so that it is always a lambda -;; function which takes one argument (the last time the job ran) and returns a -;; single value (the next time the job should run). If the input value is a -;; string this is parsed as a Vixie-style time specification, and if it is a -;; list then we arrange to eval it (but note that such lists are expected to -;; ignore the function parameter - the last run time is always read from the -;; %CURRENT-ACTION-TIME parameter object). A similar normalization is applied to -;; the action. +;; Here we must 'normalize' the next-time-function so that it is always a +;; lambda function which takes one argument (the last time the job ran) and +;; returns a single value (the next time the job should run). If the input +;; value is a string this is parsed as a Vixie-style time specification, and +;; if it is a list then we arrange to eval it (but note that such lists are +;; expected to ignore the function parameter - the last run time is always +;; read from the %CURRENT-ACTION-TIME parameter object). A similar +;; normalization is applied to the action. ;; ;; Here we also compute the first time that the job is supposed to run, by ;; finding the next legitimate time from the current configuration time (set @@ -229,7 +229,8 @@ go into the list. For example, (range 1 6 2) returns '(1 3 5)." (cond ((procedure? time-proc) time-proc) ((string? time-proc) (parse-vixie-time time-proc)) ((list? time-proc) (lambda (current-time) - (primitive-eval time-proc))) + (eval time-proc + (resolve-module '(mcron job-specifier))))) (else (throw 'mcron-error 3 "job: invalid first argument (next-time-function; " |