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

View file

@ -478,11 +478,12 @@ (define %test-halt
(define %mcron-os
;; System with an mcron service, with one mcron job for "root" and one mcron
;; 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 ()
(call-with-output-file "witness"
(lambda (port)
(display (list (getuid) (getgid)) port))))))
(unless (file-exists? "witness")
(call-with-output-file "witness"
(lambda (port)
(display (list (getuid) (getgid)) port)))))))
(job2 #~(job next-second-from
(lambda ()
(call-with-output-file "witness"