From 56e4d7204b0d4f83ab8cf4aab24199a9f8dc082c Mon Sep 17 00:00:00 2001 From: Ricardo Wurmus Date: Wed, 5 May 2021 14:47:53 +0200 Subject: 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 . * guix/profiles.scm (texlive-configuration): Delete updmap.cfg if it exists. --- guix/profiles.scm | 15 +++++++++++---- 1 file 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" -- cgit v1.2.3