all: Add a custom indentation rule for 'mcron-error'.
* .dir-locals.el: Define a custom indentation rule for 'mcron-error'. * scm/mcron/crontab.scm: Use it. * scm/mcron/job-specifier.scm: Likewise. * scm/mcron/main.scm: Likewise. * scm/mcron/vixie-specification.scm: Likewise.
This commit is contained in:
parent
b2718d2cc9
commit
f2c56d355f
5 changed files with 25 additions and 33 deletions
|
|
@ -4,4 +4,7 @@
|
||||||
(tab-width . 8)))
|
(tab-width . 8)))
|
||||||
(c-mode . ((c-file-style . "gnu")
|
(c-mode . ((c-file-style . "gnu")
|
||||||
(indent-tabs-mode . nil)))
|
(indent-tabs-mode . nil)))
|
||||||
(scheme-mode . ((indent-tabs-mode . nil))))
|
(scheme-mode
|
||||||
|
.
|
||||||
|
((indent-tabs-mode . nil)
|
||||||
|
(eval . (put 'mcron-error 'scheme-indent-function 1)))))
|
||||||
|
|
|
||||||
|
|
@ -221,8 +221,8 @@
|
||||||
;; The user is being silly. The message here is identical to the one Vixie cron
|
;; The user is being silly. The message here is identical to the one Vixie cron
|
||||||
;; used to put out, for total compatibility.
|
;; used to put out, for total compatibility.
|
||||||
|
|
||||||
(else
|
(else (mcron-error 15
|
||||||
(mcron-error 15 "usage error: file name must be specified for replace.")))
|
"usage error: file name must be specified for replace.")))
|
||||||
|
|
||||||
|
|
||||||
)) ;; End of file-level let-scopes.
|
)) ;; End of file-level let-scopes.
|
||||||
|
|
|
||||||
|
|
@ -233,8 +233,7 @@
|
||||||
((list? action) (lambda () (primitive-eval action)))
|
((list? action) (lambda () (primitive-eval action)))
|
||||||
((string? action) (lambda () (system action)))
|
((string? action) (lambda () (system action)))
|
||||||
(else
|
(else
|
||||||
(throw 'mcron-error
|
(throw 'mcron-error 2
|
||||||
2
|
|
||||||
"job: invalid second argument (action; should be lambda "
|
"job: invalid second argument (action; should be lambda "
|
||||||
"function, string or list)"))))
|
"function, string or list)"))))
|
||||||
|
|
||||||
|
|
@ -244,10 +243,9 @@
|
||||||
((list? time-proc) (lambda (current-time)
|
((list? time-proc) (lambda (current-time)
|
||||||
(primitive-eval time-proc)))
|
(primitive-eval time-proc)))
|
||||||
(else
|
(else
|
||||||
(throw 'mcron-error
|
(throw 'mcron-error 3
|
||||||
3
|
"job: invalid first argument (next-time-function; "
|
||||||
"job: invalid first argument (next-time-function; should ")
|
"should be function, string or list)"))))
|
||||||
"be function, string or list)")))
|
|
||||||
(displayable
|
(displayable
|
||||||
(cond ((not (null? displayable)) (car displayable))
|
(cond ((not (null? displayable)) (car displayable))
|
||||||
((procedure? action) "Lambda function")
|
((procedure? action) "Lambda function")
|
||||||
|
|
|
||||||
|
|
@ -217,8 +217,7 @@ $XDG_CONFIG_HOME is not defined uses ~/.config/cron instead)."
|
||||||
"/cron")))
|
"/cron")))
|
||||||
(when (eq? 2 errors)
|
(when (eq? 2 errors)
|
||||||
(mcron-error 13
|
(mcron-error 13
|
||||||
"Cannot read files in your ~/.config/cron (or ~/.cron) "
|
"Cannot read files in your ~/.config/cron (or ~/.cron) directory."))))
|
||||||
"directory."))))
|
|
||||||
|
|
||||||
(define (valid-user user-name)
|
(define (valid-user user-name)
|
||||||
"Check that USER-NAME is in the passwd database (it may happen that a user
|
"Check that USER-NAME is in the passwd database (it may happen that a user
|
||||||
|
|
@ -248,8 +247,7 @@ operation. The permissions on the /var/cron/tabs directory enforce this."
|
||||||
"/"
|
"/"
|
||||||
file-name)))))))
|
file-name)))))))
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(mcron-error
|
(mcron-error 4
|
||||||
4
|
|
||||||
"You do not have permission to access the system crontabs."))))
|
"You do not have permission to access the system crontabs."))))
|
||||||
|
|
||||||
(define (cron-file-descriptors)
|
(define (cron-file-descriptors)
|
||||||
|
|
@ -265,9 +263,7 @@ crontab. This requires that command-type is 'cron."
|
||||||
(list sock)))
|
(list sock)))
|
||||||
(lambda (key . args)
|
(lambda (key . args)
|
||||||
(delete-file config-pid-file)
|
(delete-file config-pid-file)
|
||||||
(mcron-error 1
|
(mcron-error 1 "Cannot bind to UNIX socket " config-socket-file)))
|
||||||
"Cannot bind to UNIX socket "
|
|
||||||
config-socket-file)))
|
|
||||||
'()))
|
'()))
|
||||||
|
|
||||||
(define (process-update-request fdes-list)
|
(define (process-update-request fdes-list)
|
||||||
|
|
@ -319,15 +315,12 @@ comes in on the above socket."
|
||||||
(when (eq? command-type 'cron)
|
(when (eq? command-type 'cron)
|
||||||
(unless (eqv? (getuid) 0)
|
(unless (eqv? (getuid) 0)
|
||||||
(mcron-error 16
|
(mcron-error 16
|
||||||
"This program must be run by the root user (and should "
|
"This program must be run by the root user (and should have been "
|
||||||
"have been installed as such)."))
|
"installed as such)."))
|
||||||
(when (access? config-pid-file F_OK)
|
(when (access? config-pid-file F_OK)
|
||||||
(mcron-error 1
|
(mcron-error 1
|
||||||
"A cron daemon is already running.\n"
|
"A cron daemon is already running.\n (If you are sure this is not"
|
||||||
" (If you are sure this is not true, remove the file\n"
|
" true, remove the file\n " config-pid-file ".)"))
|
||||||
" "
|
|
||||||
config-pid-file
|
|
||||||
".)"))
|
|
||||||
(unless (option-ref options 'schedule #f)
|
(unless (option-ref options 'schedule #f)
|
||||||
(with-output-to-file config-pid-file noop))
|
(with-output-to-file config-pid-file noop))
|
||||||
(setenv "MAILTO" #f)
|
(setenv "MAILTO" #f)
|
||||||
|
|
|
||||||
|
|
@ -162,9 +162,7 @@
|
||||||
(parse-vixie-environment line)
|
(parse-vixie-environment line)
|
||||||
(parse-vixie-line line)))
|
(parse-vixie-line line)))
|
||||||
(lambda (key exit-code . msg)
|
(lambda (key exit-code . msg)
|
||||||
(throw
|
(throw 'mcron-error exit-code
|
||||||
'mcron-error
|
|
||||||
exit-code
|
|
||||||
(apply string-append
|
(apply string-append
|
||||||
(number->string report-line)
|
(number->string report-line)
|
||||||
": "
|
": "
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue