From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([209.51.188.92]:60356) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkEoZ-0003Ce-8i for guix-patches@gnu.org; Thu, 17 Jan 2019 16:03:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkEoY-0008OD-F0 for guix-patches@gnu.org; Thu, 17 Jan 2019 16:03:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:36090) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gkEoY-0008NQ-Bo for guix-patches@gnu.org; Thu, 17 Jan 2019 16:03:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1gkEoY-0007QX-12 for guix-patches@gnu.org; Thu, 17 Jan 2019 16:03:02 -0500 Subject: [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook. Resent-Message-ID: Received: from eggs.gnu.org ([209.51.188.92]:60185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkEnu-00036H-5F for guix-patches@gnu.org; Thu, 17 Jan 2019 16:02:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gkEnr-0007fr-Ts for guix-patches@gnu.org; Thu, 17 Jan 2019 16:02:21 -0500 Received: from mira.cbaines.net ([2a01:7e00::f03c:91ff:fe69:8da9]:60350) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkEnr-0007ej-LV for guix-patches@gnu.org; Thu, 17 Jan 2019 16:02:19 -0500 Received: from localhost (cpc102582-walt20-2-0-cust14.13-2.cable.virginm.net [86.27.34.15]) by mira.cbaines.net (Postfix) with ESMTPSA id 204E916A30 for ; Thu, 17 Jan 2019 21:02:18 +0000 (GMT) Received: from localhost (localhost [local]) by localhost (OpenSMTPD) with ESMTPA id fcaa7d57 for ; Thu, 17 Jan 2019 21:02:17 +0000 (UTC) From: Christopher Baines Date: Thu, 17 Jan 2019 21:02:17 +0000 Message-Id: <20190117210217.18351-1-mail@cbaines.net> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+kyle=kyleam.com@gnu.org Sender: "Guix-patches" To: 34118@debbugs.gnu.org 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 exam= ple is the profile just containing texlive-fonts-txfonts. * guix/profiles.scm (texlive-configuration): Check that the texmf.cnf fil= e exists before trying to change it. --- guix/profiles.scm | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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 =3D .*") - (string-append "TEXMFROOT =3D " #$output "/share\n")) - (("^TEXMF =3D .*") - "TEXMF =3D $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 =3D .*") + (string-append "TEXMFROOT =3D " #$output "/share\n")) + (("^TEXMF =3D .*") + "TEXMF =3D $TEXMFROOT/share/texmf-dist\n")))) #t))) =20 (with-monad %store-monad --=20 2.20.1