From c568191a9306cb58a718860ca5b8768e91627ab0 Mon Sep 17 00:00:00 2001 From: Ludovic Courtès Date: Mon, 20 Apr 2015 10:20:17 +0200 Subject: 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 file changed, 17 insertions(+), 8 deletions(-) diff --git a/guix/profiles.scm b/guix/profiles.scm index 620feff97e..4bb309305b 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)) -- cgit v1.2.3