all messages for Guix-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
* [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook.
@ 2019-01-17 21:02 Christopher Baines
  2019-01-18 15:51 ` Ludovic Courtès
  0 siblings, 1 reply; 3+ messages in thread
From: Christopher Baines @ 2019-01-17 21:02 UTC (permalink / raw)
  To: 34118

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

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook.
  2019-01-17 21:02 [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook Christopher Baines
@ 2019-01-18 15:51 ` Ludovic Courtès
  2019-01-18 16:19   ` bug#34118: " Christopher Baines
  0 siblings, 1 reply; 3+ messages in thread
From: Ludovic Courtès @ 2019-01-18 15:51 UTC (permalink / raw)
  To: Christopher Baines; +Cc: 34118

Hello,

Christopher Baines <mail@cbaines.net> skribis:

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

LGTM, thanks!

Ludo'.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* bug#34118: [PATCH] guix: Add guard to texlive-configuration profile hook.
  2019-01-18 15:51 ` Ludovic Courtès
@ 2019-01-18 16:19   ` Christopher Baines
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Baines @ 2019-01-18 16:19 UTC (permalink / raw)
  To: Ludovic Courtès; +Cc: 34118-done

[-- Attachment #1: Type: text/plain, Size: 510 bytes --]


Ludovic Courtès <ludo@gnu.org> writes:

> Hello,
>
> Christopher Baines <mail@cbaines.net> skribis:
>
>> 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.
>
> LGTM, thanks!

Great, I've pushed this to master now.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 962 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-01-18 16:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-17 21:02 [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook Christopher Baines
2019-01-18 15:51 ` Ludovic Courtès
2019-01-18 16:19   ` bug#34118: " Christopher Baines

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.