me
/
guix
Archived
1
0
Fork 0

gnu: mcron: Update to 1.1.1.

Fixes <https://bugs.gnu.org/31113>.
Reported by George myglc2 Clemmer <myglc2@gmail.com>.

* gnu/packages/guile.scm (mcron): Update to 1.1.1.
[arguments]: Change timezone in 'set-timezone' phase.  Remove
'disable-schedule-test' and 'wrap-programs' phases.  Add 'adjust-tests'
phase.
* gnu/tests/base.scm (%mcron-os): Change JOB1 to use the 'next-seconds'
form.
master
Ludovic Courtès 2018-04-19 00:04:41 +02:00
parent 4f04e271e3
commit 67a51b6755
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
2 changed files with 28 additions and 29 deletions

View File

@ -661,48 +661,46 @@ library.")
(define-public mcron (define-public mcron
(package (package
(name "mcron") (name "mcron")
(version "1.1") (version "1.1.1")
(source (origin (source (origin
(method url-fetch) (method url-fetch)
(uri (string-append "mirror://gnu/mcron/mcron-" (uri (string-append "mirror://gnu/mcron/mcron-"
version ".tar.gz")) version ".tar.gz"))
(sha256 (sha256
(base32 (base32
"1f547sqqfbp0k02sqk4ivwx8y9mx8l0rrx1c9rrj033av073h6xq")))) "1i9mcp6r6my61zfiydsm3n6my41mwvl7dfala4q29qx0zn1ynlm4"))))
(build-system gnu-build-system) (build-system gnu-build-system)
(arguments (arguments
'(#:phases (modify-phases %standard-phases '(#:phases (modify-phases %standard-phases
(add-before 'check 'set-timezone (add-before 'check 'set-timezone
(lambda* (#:key inputs #:allow-other-keys) (lambda* (#:key inputs #:allow-other-keys)
;; 'tests/schedule.sh' expects to be running in UTC+1. ;; 'tests/job-specifier.scm' expects to be running in
;; UTC-2 or something.
;; FIXME: This issue is being investigated upstream, for
;; now we'll just skip the tests (see below):
;; <https://lists.gnu.org/archive/html/bug-mcron/2018-04/msg00005.html>.
(let ((tzdata (assoc-ref inputs "tzdata"))) (let ((tzdata (assoc-ref inputs "tzdata")))
(setenv "TZDIR" (setenv "TZDIR"
(string-append tzdata (string-append tzdata
"/share/zoneinfo")) "/share/zoneinfo"))
(setenv "TZ" "UTC+1") (setenv "TZ" "UTC-2")
#t))) #t)))
(add-before 'check 'disable-schedule-test (add-before 'check 'adjust-tests
(lambda _ (lambda _
;; But! As it turns out, that test additionally relies (substitute* "tests/job-specifier.scm"
;; on non-deterministic behavior; see ;; (getpw) fails with "entry not found" in the build
;; <https://lists.gnu.org/archive/html/bug-mcron/2018-03/msg00001.html>. ;; environment, so pass an argument.
(substitute* "tests/schedule.sh" (("\\(getpw\\)")
(("mkdir cron") "exit 77\n")) "(getpwnam (getuid))")
#t)) ;; The build environment lacks an entry for root in
(add-after 'install 'wrap-programs ;; /etc/passwd.
(lambda* (#:key outputs #:allow-other-keys) (("\\(getpw 0\\)")
;; By default mcron doesn't have its own modules in the "(getpwnam \"nobody\")")
;; search path, so the 'mcron' command fails to start.
(let* ((output (assoc-ref outputs "out")) ;; FIXME: Skip the 4 faulty tests (see above).
(modules (string-append output (("\\(test-equal \"next-year\"" all)
"/share/guile/site/2.2")) (string-append "(test-skip 4)\n" all)))
(go (string-append output #t)))))
"/lib/guile/2.2/site-ccache")))
(wrap-program (string-append output "/bin/mcron")
`("GUILE_LOAD_PATH" ":" prefix
(,modules))
`("GUILE_LOAD_COMPILED_PATH" ":" prefix (,go)))
#t))))))
(native-inputs `(("pkg-config" ,pkg-config) (native-inputs `(("pkg-config" ,pkg-config)
("tzdata" ,tzdata-for-tests))) ("tzdata" ,tzdata-for-tests)))
(inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.2))) (inputs `(("ed" ,ed) ("which" ,which) ("guile" ,guile-2.2)))

View File

@ -478,11 +478,12 @@ in a loop. See <http://bugs.gnu.org/26931>.")
(define %mcron-os (define %mcron-os
;; System with an mcron service, with one mcron job for "root" and one mcron ;; System with an mcron service, with one mcron job for "root" and one mcron
;; job for an unprivileged user. ;; job for an unprivileged user.
(let ((job1 #~(job next-second-from (let ((job1 #~(job '(next-second '(0 5 10 15 20 25 30 35 40 45 50 55))
(lambda () (lambda ()
(call-with-output-file "witness" (unless (file-exists? "witness")
(lambda (port) (call-with-output-file "witness"
(display (list (getuid) (getgid)) port)))))) (lambda (port)
(display (list (getuid) (getgid)) port)))))))
(job2 #~(job next-second-from (job2 #~(job next-second-from
(lambda () (lambda ()
(call-with-output-file "witness" (call-with-output-file "witness"