diff options
author | Marius Bakke <mbakke@fastmail.com> | 2018-09-26 01:11:32 +0200 |
---|---|---|
committer | Marius Bakke <mbakke@fastmail.com> | 2018-09-26 01:11:32 +0200 |
commit | 6a0427af6cc3d52c0efc09262e90c1858ae6f40e (patch) | |
tree | afedf3a5728dfac46c20aed448326debccf96562 /guix/scripts/pull.scm | |
parent | 985d542e028517b2888fa61831233a2b60dc7d48 (diff) | |
parent | 3b97a1779f3b65d582b8edc8c154b6414314b946 (diff) | |
download | gnu-guix-6a0427af6cc3d52c0efc09262e90c1858ae6f40e.tar gnu-guix-6a0427af6cc3d52c0efc09262e90c1858ae6f40e.tar.gz |
Merge branch 'master' into core-updates
Diffstat (limited to 'guix/scripts/pull.scm')
-rw-r--r-- | guix/scripts/pull.scm | 20 |
1 files changed, 18 insertions, 2 deletions
diff --git a/guix/scripts/pull.scm b/guix/scripts/pull.scm index 10e1a99e54..39aebb18e2 100644 --- a/guix/scripts/pull.scm +++ b/guix/scripts/pull.scm @@ -180,9 +180,25 @@ Download and deploy the latest version of Guix.\n")) (define (honor-x509-certificates store) "Use the right X.509 certificates for Git checkouts over HTTPS." - (let ((file (getenv "SSL_CERT_FILE")) + ;; On distros such as CentOS 7, /etc/ssl/certs contains only a couple of + ;; files (instead of all the certificates) among which "ca-bundle.crt". On + ;; other distros /etc/ssl/certs usually contains the whole set of + ;; certificates along with "ca-certificates.crt". Try to choose the right + ;; one. + (let ((file (letrec-syntax ((choose + (syntax-rules () + ((_ file rest ...) + (let ((f file)) + (if (and f (file-exists? f)) + f + (choose rest ...)))) + ((_) + #f)))) + (choose (getenv "SSL_CERT_FILE") + "/etc/ssl/certs/ca-certificates.crt" + "/etc/ssl/certs/ca-bundle.crt"))) (directory (or (getenv "SSL_CERT_DIR") "/etc/ssl/certs"))) - (if (or (and file (file-exists? file)) + (if (or file (and=> (stat directory #f) (lambda (st) (> (stat:nlink st) 2)))) |