guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

03/03: gnu: mcron: Update to 1.1.1.


From: Ludovic Courtès
Subject: 03/03: gnu: mcron: Update to 1.1.1.
Date: Wed, 18 Apr 2018 18:14:57 -0400 (EDT)

civodul pushed a commit to branch master
in repository guix.

commit 67a51b675538065a4ec3eb06428d8a4021fdbb87
Author: Ludovic Courtès <address@hidden>
Date:   Thu Apr 19 00:04:41 2018 +0200

    gnu: mcron: Update to 1.1.1.
    
    Fixes <https://bugs.gnu.org/31113>.
    Reported by George myglc2 Clemmer <address@hidden>.
    
    * 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.
---
 gnu/packages/guile.scm | 48 +++++++++++++++++++++++-------------------------
 gnu/tests/base.scm     |  9 +++++----
 2 files changed, 28 insertions(+), 29 deletions(-)

diff --git a/gnu/packages/guile.scm b/gnu/packages/guile.scm
index 03a551a..b954988 100644
--- a/gnu/packages/guile.scm
+++ b/gnu/packages/guile.scm
@@ -661,48 +661,46 @@ library.")
 (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)))
diff --git a/gnu/tests/base.scm b/gnu/tests/base.scm
index 63d2789..3faedde 100644
--- a/gnu/tests/base.scm
+++ b/gnu/tests/base.scm
@@ -478,11 +478,12 @@ in a loop.  See <http://bugs.gnu.org/26931>.")
 (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"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]