profiles: texlive-configuration: Handle updmap.cfg conflict.

The profile hook would fail when preparing an environment for a package using
texlive-union, because the union already had a updmap.cfg file.

Reported-by: Lars-Dominik Braun <ldb@leibniz-psychology.org>.

* guix/profiles.scm (texlive-configuration): Delete updmap.cfg if it exists.
This commit is contained in:
Ricardo Wurmus 2021-05-05 14:47:53 +02:00
parent 0f116d7f90
commit 56e4d7204b
No known key found for this signature in database
GPG key ID: 197A5888235FACAC

View file

@ -1712,11 +1712,18 @@ (define build
(setenv "TEXMF" (string-append #$output "/share/texmf-dist"))
;; Remove invalid maps from config file.
(let ((web2c (string-append #$output "/share/texmf-config/web2c/"))
(maproot (string-append #$output "/share/texmf-dist/fonts/map/")))
(let* ((web2c (string-append #$output "/share/texmf-config/web2c/"))
(maproot (string-append #$output "/share/texmf-dist/fonts/map/"))
(updmap.cfg (string-append web2c "updmap.cfg")))
(mkdir-p web2c)
(copy-file #$updmap.cfg (string-append web2c "updmap.cfg"))
(make-file-writable (string-append web2c "updmap.cfg"))
;; Some profiles may already have this file, which prevents us
;; from copying it. Since we need to generate it from scratch
;; anyway, we delete it here.
(when (file-exists? updmap.cfg)
(delete-file updmap.cfg))
(copy-file #$updmap.cfg updmap.cfg)
(make-file-writable updmap.cfg)
(let* ((port (open-pipe* OPEN_WRITE
#$(file-append texlive-bin "/bin/updmap-sys")
"--syncwithtrees"