[PATCH] guix: Add guard to texlive-configuration profile hook.

  • Done
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Christopher Baines
Owner
unassigned
Submitted by
Christopher Baines
Severity
normal

Debbugs page

Christopher Baines wrote 6 years ago
(address . guix-patches@gnu.org)
20190117210217.18351-1-mail@cbaines.net
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(-)

Toggle diff (28 lines)
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
Ludovic Courtès wrote 6 years ago
(name . Christopher Baines)(address . mail@cbaines.net)(address . 34118@debbugs.gnu.org)
87lg3irmju.fsf@gnu.org
Hello,

Christopher Baines <mail@cbaines.net> skribis:

Toggle quote (7 lines)
> 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'.
Christopher Baines wrote 6 years ago
(name . Ludovic Courtès)(address . ludo@gnu.org)(address . 34118-done@debbugs.gnu.org)
8736pqlz0g.fsf@cbaines.net
Ludovic Courtès <ludo@gnu.org> writes:

Toggle quote (13 lines)
> 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.
-----BEGIN PGP SIGNATURE-----

iQKTBAEBCgB9FiEEPonu50WOcg2XVOCyXiijOwuE9XcFAlxB/H9fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcACgkQXiijOwuE
9XejQQ/+OHVQhCPW+jgXypnohzMj9ZvFKsYh7zs64HXwKgF2jALPNiudB5BfTEKN
Ju+b0nYi4BePAPahEr10dY2YDgN7V2jLgpYS2gpyWiLUZ6EAJpX7NLwl4C+dcc8W
5t68JU7rhXScZMgg9JFpAGZeSJDosgSNmlxv/JbHmZRUKHQXWT1qSEfnIjvv9CGi
4grhy2hJrYvFXmbl1zyjwGY2btzSpotyZMaWnnMfORrFIpcB/wIvo6u0IxnF0hHD
MZ4B4J1ewjuBQBzhwzH9S2idRiDFGZDFsIyuOE+Fy6wr4bAwh8vmTrl0Euhhp7Sy
brB6EDtFqJ3W3Y6TiU0zxbpXcLX9i0irPCNlObc6vBDDVtbbhxpMKwNCY8OS0l5L
Awq4Q02awxKUY3dMA5I+PcIIIZmLjoUokIoFr0zqCc4apHgy/bcuZujwN1rafOPu
trRcRB7/erS9p1qudCYZT9PRD39OjhoR8zOrNJmVk7IIgBbDt6EzPd00mSzdls7C
r6CTHJyFjrXpG3dlx5N2k1LZ4Odb1ZgasHRtFvm4Lt0sh1wTuUVXunA4aXqCs+Zq
l+ODS4srY8+nLpAyytmsY43X33LORH42Igosgc0LMwlv3O68HOMNfk61VUzP8sSH
ToOA4wMXOff8mwWXtEJvPeiB1PDc4jYYfB8UTi66f4QUIs7Pva4=
=A5x7
-----END PGP SIGNATURE-----

Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 34118@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 34118
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help