guix-commits
[Top][All Lists]
Advanced

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

01/01: guix: Add guard to texlive-configuration profile hook.


From: guix-commits
Subject: 01/01: guix: Add guard to texlive-configuration profile hook.
Date: Fri, 18 Jan 2019 11:15:55 -0500 (EST)

cbaines pushed a commit to branch master
in repository guix.

commit cf22e99f0252a4712ab94d630dc4914c9a89f18d
Author: Christopher Baines <address@hidden>
Date:   Thu Jan 17 21:00:19 2019 +0000

    guix: Add guard to texlive-configuration profile hook.
    
    It is possible to generate a profile where this hook will crash, as the
    texmf.cnf file does not exist to be patched by substitute*. A simple example
    is the profile just containing texlive-fonts-txfonts.
    
    * guix/profiles.scm (texlive-configuration): Check that the texmf.cnf file
    exists before trying to change it.
---
 guix/profiles.scm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)

diff --git a/guix/profiles.scm b/guix/profiles.scm
index d22539b..598e0ac 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1363,12 +1363,15 @@ MANIFEST."
                                       (manifest-entries manifest))
                        #:create-all-directories? #t
                        #:log-port (%make-void-port "w"))
-          (substitute* (string-append #$output
-                                      "/share/texmf-dist/web2c/texmf.cnf")
-            (("^TEXMFROOT = .*")
-             (string-append "TEXMFROOT = " #$output "/share\n"))
-            (("^TEXMF = .*")
-             "TEXMF = $TEXMFROOT/share/texmf-dist\n"))
+          (let ((texmf.cnf (string-append
+                            #$output
+                            "/share/texmf-dist/web2c/texmf.cnf")))
+            (when (file-exists? texmf.cnf)
+              (substitute* texmf.cnf
+                (("^TEXMFROOT = .*")
+                 (string-append "TEXMFROOT = " #$output "/share\n"))
+                (("^TEXMF = .*")
+                 "TEXMF = $TEXMFROOT/share/texmf-dist\n"))))
           #t)))
 
     (with-monad %store-monad



reply via email to

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