guix-commits
[Top][All Lists]
Advanced

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

[no subject]


From: Ludovic Courtès
Date: Mon, 22 Jan 2018 07:30:19 -0500 (EST)

branch: master
commit 327d7be013b34f1f86d411bc97b757a5e183db4e
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jan 22 13:04:20 2018 +0100

    Initialize libgit's TLS certificate directory once and for all.
    
    * src/cuirass/base.scm (prepare-git): New procedure.  Body moved from...
    (process-specs): ... here.  Remove it.
    * bin/cuirass.in (main): Call 'prepare-git'.
---
 bin/cuirass.in       |  1 +
 src/cuirass/base.scm | 25 ++++++++++++++-----------
 2 files changed, 15 insertions(+), 11 deletions(-)

diff --git a/bin/cuirass.in b/bin/cuirass.in
index 0da5c06..f11a6a5 100644
--- a/bin/cuirass.in
+++ b/bin/cuirass.in
@@ -92,6 +92,7 @@ exec ${GUILE:address@hidden@} --no-auto-compile -e main -s 
"$0" "$@"
               (host      (option-ref opts 'listen "localhost"))
               (interval  (string->number (option-ref opts 'interval "10")))
               (specfile  (option-ref opts 'specifications #f)))
+          (prepare-git)
           (with-database db
             (and specfile
                  (let ((new-specs (save-module-excursion
diff --git a/src/cuirass/base.scm b/src/cuirass/base.scm
index ad45b20..1daa428 100644
--- a/src/cuirass/base.scm
+++ b/src/cuirass/base.scm
@@ -46,6 +46,7 @@
             compile
             evaluate
             build-packages
+            prepare-git
             process-specs
             set-guix-package-path!
             ;; Parameters.
@@ -339,21 +340,23 @@ and so on. "
     (format #t "success: ~a, fail: ~a\n" success fail)
     results))
 
+(define (prepare-git)
+  "Prepare Guile-Git's TLS support and all."
+  ;; Catch and report git errors.
+  (with-git-error-handling
+   ;; Try the 'GIT_SSL_CAINFO' or 'SSL_CERT_FILE' file first, then search the
+   ;; 'SSL_CERT_DIR' directory.
+   (let ((directory (getenv "SSL_CERT_DIR"))
+         (file      (or (getenv "GIT_SSL_CAINFO")
+                        (getenv "SSL_CERT_FILE"))))
+     (when (or directory file)
+       (set-tls-certificate-locations! directory file)))))
+
 (define (process-specs db jobspecs)
   "Evaluate and build JOBSPECS and store results in DB."
   (define (process spec)
     (with-store store
       (let ((stamp (db-get-stamp db spec)))
-        ;; Catch and report git errors.
-        (with-git-error-handling
-         ;; Try the 'GIT_SSL_CAINFO' or 'SSL_CERT_FILE' file first, then
-         ;; search the 'SSL_CERT_DIR' directory.
-         (let ((directory (getenv "SSL_CERT_DIR"))
-               (file      (or (getenv "GIT_SSL_CAINFO")
-                              (getenv "SSL_CERT_FILE"))))
-           (when (or directory file)
-             (set-tls-certificate-locations! directory file)))
-
          (receive (checkout commit)
              (fetch-repository store spec)
            (when commit
@@ -377,7 +380,7 @@ and so on. "
                  (let* ((spec* (acons #:current-commit commit spec))
                         (jobs  (evaluate store db spec*)))
                    (build-packages store db jobs))))
-             (db-add-stamp db spec commit)))))))
+             (db-add-stamp db spec commit))))))
 
   (for-each process jobspecs))
 



reply via email to

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