guix-commits
[Top][All Lists]
Advanced

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

01/03: profiles: Create a CA certificate bundle only when it would be no


From: Ludovic Courtès
Subject: 01/03: profiles: Create a CA certificate bundle only when it would be non-empty.
Date: Mon, 20 Apr 2015 13:55:37 +0000

civodul pushed a commit to branch master
in repository guix.

commit c568191a9306cb58a718860ca5b8768e91627ab0
Author: Ludovic Courtès <address@hidden>
Date:   Mon Apr 20 10:20:17 2015 +0200

    profiles: Create a CA certificate bundle only when it would be non-empty.
    
    * guix/profiles.scm (ca-certificate-bundle): Create
      $output/etc/ssl/certs if and only if CA-FILES is non-empty.
---
 guix/profiles.scm |   25 +++++++++++++++++--------
 1 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index 620feff..4bb3093 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -466,7 +466,8 @@ MANIFEST.  Single-file bundles are required by programs 
such as Git and Lynx."
                      (rnrs io ports)
                      (srfi srfi-1)
                      (srfi srfi-26)
-                     (ice-9 ftw))
+                     (ice-9 ftw)
+                     (ice-9 match))
 
         (define (pem-file? file)
           (string-suffix? ".pem" file))
@@ -492,13 +493,21 @@ MANIFEST.  Single-file bundles are required by programs 
such as Git and Lynx."
         (setenv "LOCPATH" (string-append #+glibc-utf8-locales "/lib/locale"))
         (setlocale LC_ALL "en_US.UTF-8")
 
-        (let ((ca-files (append-map ca-files
-                                    '#$(manifest-inputs manifest)))
-              (result   (string-append #$output "/etc/ssl/certs")))
-          (mkdir-p result)
-          (concatenate-files ca-files
-                             (string-append result
-                                            "/ca-certificates.crt")))))
+        (match (append-map ca-files '#$(manifest-inputs manifest))
+          (()
+           ;; Since there are no CA files, just create an empty directory.  Do
+           ;; not create the etc/ssl/certs sub-directory, since that would
+           ;; wrongfully lead to a message about 'SSL_CERT_DIR' needing to be
+           ;; defined.
+           (mkdir #$output)
+           #t)
+          ((ca-files ...)
+           (let ((result (string-append #$output "/etc/ssl/certs")))
+             (mkdir-p result)
+             (concatenate-files ca-files
+                                (string-append result
+                                               "/ca-certificates.crt"))
+             #t)))))
 
   (gexp->derivation "ca-certificate-bundle" build
                     #:modules '((guix build utils))



reply via email to

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