all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Christopher Baines <mail@cbaines.net>
To: 34118@debbugs.gnu.org
Subject: [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook.
Date: Thu, 17 Jan 2019 21:02:17 +0000	[thread overview]
Message-ID: <20190117210217.18351-1-mail@cbaines.net> (raw)

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 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
-- 
2.20.1

             reply	other threads:[~2019-01-17 21:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-17 21:02 Christopher Baines [this message]
2019-01-18 15:51 ` [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook Ludovic Courtès
2019-01-18 16:19   ` bug#34118: " Christopher Baines

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190117210217.18351-1-mail@cbaines.net \
    --to=mail@cbaines.net \
    --cc=34118@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/guix.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.