From c173819c8e5235ce02d60b79bd88b10023a7c614 Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Sun, 30 Jul 2023 10:57:41 +0200 Subject: guix: profiles: Fix auto-generated file deletion. * guix/profiles.scm (texlive-font-maps): Make sure auto-generated file exists before deleting it, which is not guaranteed when creating the initial texmf tree union. This is a followup to e43cbeafd1b632f39b08b3644af5230d5350a656. --- guix/profiles.scm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'guix/profiles.scm') diff --git a/guix/profiles.scm b/guix/profiles.scm index 6c88759cae..c62d7f4d22 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1815,9 +1815,12 @@ MANIFEST." #:create-all-directories? #t #:log-port (%make-void-port "w")) - ;; Clear files that are going to be regenerated. + ;; Clear files that are going to be regenerated, or copied from + ;; a different place, in order to prevent failures during profile + ;; generation. (with-directory-excursion "/tmp/texlive/share/texmf-dist" - (for-each delete-file + (for-each (lambda (file) + (when (file-exists? file) (delete-file file))) (list "fonts/map/dvipdfmx/updmap/kanjix.map" "fonts/map/dvips/updmap/builtin35.map" "fonts/map/dvips/updmap/download35.map" -- cgit v1.2.3 From 3481a5cb37cacbb54f74a2b1fa52ffc5c972b09f Mon Sep 17 00:00:00 2001 From: Nicolas Goaziou Date: Wed, 9 Aug 2023 10:45:42 +0200 Subject: guix: profiles: Do not raise error on incomplete TeX Live setups. * guix/profiles.scm (texlive-font-maps): Check if TEXLIVE-SCRIPTS is present in the manifest before trying to generate font maps. --- guix/profiles.scm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'guix/profiles.scm') diff --git a/guix/profiles.scm b/guix/profiles.scm index c62d7f4d22..2bd6477cf8 100644 --- a/guix/profiles.scm +++ b/guix/profiles.scm @@ -1787,6 +1787,11 @@ MANIFEST." (cons (gexp-input thing output) (append-map entry->texlive-input deps)) '())))) + (define texlive-scripts-entry? + (match-lambda + (($ name version output thing deps) + (or (string=? "texlive-scripts" name) + (any texlive-scripts-entry? deps))))) (define texlive-inputs (append-map entry->texlive-input (manifest-entries manifest))) (define texlive-scripts @@ -1887,9 +1892,11 @@ MANIFEST." (copy-recursively a b) (invoke mktexlsr b) (install-file (string-append b "/ls-R") a)))))) - (with-monad %store-monad - (if (pair? texlive-inputs) + ;; `texlive-scripts' brings essential files to generate font maps. + ;; Therefore, it must be present in the profile. This check prevents + ;; incomplete modular TeX Live installations to generate errors. + (if (any texlive-scripts-entry? (manifest-entries manifest)) (gexp->derivation "texlive-font-maps" build #:substitutable? #f #:local-build? #t -- cgit v1.2.3