summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicardo Wurmus <rekado@elephly.net>2021-05-05 14:47:53 +0200
committerRicardo Wurmus <rekado@elephly.net>2021-05-05 14:50:04 +0200
commit56e4d7204b0d4f83ab8cf4aab24199a9f8dc082c (patch)
treeed339b306e4dff0abd75b1857ae461747f3d8037
parent0f116d7f909b6c1f1cc95c8b07d688b697d229b1 (diff)
downloadguix-56e4d7204b0d4f83ab8cf4aab24199a9f8dc082c.tar.gz
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.
-rw-r--r--guix/profiles.scm15
1 files changed, 11 insertions, 4 deletions
diff --git a/guix/profiles.scm b/guix/profiles.scm
index c1c6281eb0..0044851dc2 100644
--- a/guix/profiles.scm
+++ b/guix/profiles.scm
@@ -1712,11 +1712,18 @@ MANIFEST."
               (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"