diff options
author | Christopher Baines <mail@cbaines.net> | 2019-01-17 21:00:19 +0000 |
---|---|---|
committer | Christopher Baines <mail@cbaines.net> | 2019-01-18 16:15:33 +0000 |
commit | cf22e99f0252a4712ab94d630dc4914c9a89f18d (patch) | |
tree | 960a46f5cf984c5c39378a6fb0b0aca5ea9689be | |
parent | 6654f8c1447d80c4899c4234306801407315b31f (diff) | |
download | guix-cf22e99f0252a4712ab94d630dc4914c9a89f18d.tar guix-cf22e99f0252a4712ab94d630dc4914c9a89f18d.tar.gz |
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.
-rw-r--r-- | guix/profiles.scm | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm index d22539bdb2..598e0acf62 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 |