From patchwork Thu Jan 17 21:02:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christopher Baines X-Patchwork-Id: 758 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id DCBC116A70; Thu, 17 Jan 2019 21:03:13 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,UNPARSEABLE_RELAY autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTP id A652D16A60 for ; Thu, 17 Jan 2019 21:03:13 +0000 (GMT) Received: from localhost ([127.0.0.1]:54900 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gkEoi-0003FI-ME for patchwork@mira.cbaines.net; Thu, 17 Jan 2019 16:03:12 -0500 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 X-Loop: help-debbugs@gnu.org Subject: [bug#34118] [PATCH] guix: Add guard to texlive-configuration profile hook. Resent-From: Christopher Baines Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 17 Jan 2019 21:03:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 34118 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 34118@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.154775895828514 (code B ref -1); Thu, 17 Jan 2019 21:03:01 +0000 Received: (at submit) by debbugs.gnu.org; 17 Jan 2019 21:02:38 +0000 Received: from localhost ([127.0.0.1]:35371 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkEo9-0007Pq-Sd for submit@debbugs.gnu.org; Thu, 17 Jan 2019 16:02:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:49989) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1gkEo8-0007Pd-8O for submit@debbugs.gnu.org; Thu, 17 Jan 2019 16:02:36 -0500 Received: from lists.gnu.org ([209.51.188.17]:50332) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gkEnu-0007i5-S2 for submit@debbugs.gnu.org; Thu, 17 Jan 2019 16:02:25 -0500 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> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6.x X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: "Guix-patches" X-getmail-retrieved-from-mailbox: Patches 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 example is the profile just containing texlive-fonts-txfonts. * guix/profiles.scm (texlive-configuration): Check that the texmf.cnf file 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 = .*") - (string-append "TEXMFROOT = " #$output "/share\n")) - (("^TEXMF = .*") - "TEXMF = $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 = .*") + (string-append "TEXMFROOT = " #$output "/share\n")) + (("^TEXMF = .*") + "TEXMF = $TEXMFROOT/share/texmf-dist\n")))) #t))) (with-monad %store-monad