From patchwork Wed Dec 22 09:01:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Xinglu Chen X-Patchwork-Id: 35581 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 5101727BBEA; Wed, 22 Dec 2021 09:02:31 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-0.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,FROM_SUSPICIOUS_NTLD,MAILING_LIST_MULTI,PDS_OTHER_BAD_TLD, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id 09B1F27BBE9 for ; Wed, 22 Dec 2021 09:02:31 +0000 (GMT) Received: from localhost ([::1]:48056 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1mzxW2-0001SO-1O for patchwork@mira.cbaines.net; Wed, 22 Dec 2021 04:02:30 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39238) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzxVa-0001Rx-Vs for guix-patches@gnu.org; Wed, 22 Dec 2021 04:02:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:45220) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1mzxVa-00033k-Lk for guix-patches@gnu.org; Wed, 22 Dec 2021 04:02:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1mzxVa-0005Bu-Cl for guix-patches@gnu.org; Wed, 22 Dec 2021 04:02:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#52731] [PATCH] import: texlive: Check if Subversion is installed. Resent-From: Xinglu Chen Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 22 Dec 2021 09:02:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 52731 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 52731@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.164016367019889 (code B ref -1); Wed, 22 Dec 2021 09:02:02 +0000 Received: (at submit) by debbugs.gnu.org; 22 Dec 2021 09:01:10 +0000 Received: from localhost ([127.0.0.1]:56766 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzxUj-0005Aj-Vl for submit@debbugs.gnu.org; Wed, 22 Dec 2021 04:01:10 -0500 Received: from lists.gnu.org ([209.51.188.17]:49670) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1mzxUi-0005Ac-U4 for submit@debbugs.gnu.org; Wed, 22 Dec 2021 04:01:09 -0500 Received: from eggs.gnu.org ([209.51.188.92]:38992) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzxUi-0001Je-9k for guix-patches@gnu.org; Wed, 22 Dec 2021 04:01:08 -0500 Received: from h87-96-130-155.cust.a3fiber.se ([87.96.130.155]:41712 helo=mail.yoctocell.xyz) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1mzxUf-0002sz-Iu for guix-patches@gnu.org; Wed, 22 Dec 2021 04:01:07 -0500 From: Xinglu Chen DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yoctocell.xyz; s=mail; t=1640163661; bh=QhAXxenw6O3CIlwMypFivsF3BVeyKV/oJnqhtXUdUW0=; h=From:To:Subject:Date; b=EEm2WDJC+PwPvfIjzuMssGfWVYpgRrkShUzALKn9rtPnNRRvZAHfXvPAkRRt6gsB5 rRbHkPKVCYy1jhutHayVd0jDxTAeRJA9EJxfU4hdbhAIju62oqOHpWESbPDnxqyOay LEB/6HHcsLKlQu/cC1wVudrW9Os147EDPNqrjQIU= Message-Id: <132d0f25d38be2a34abec3c43e4d685cdd0abe65.1640163645.git.public@yoctocell.xyz> Date: Wed, 22 Dec 2021 10:01:01 +0100 MIME-Version: 1.0 Received-SPF: pass client-ip=87.96.130.155; envelope-from=public@yoctocell.xyz; helo=mail.yoctocell.xyz X-Spam_score_int: 18 X-Spam_score: 1.8 X-Spam_bar: + X-Spam_report: (1.8 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FROM_SUSPICIOUS_NTLD=0.499, FROM_SUSPICIOUS_NTLD_FP=0.397, PDS_OTHER_BAD_TLD=1.999, PDS_RDNS_DYNAMIC_FP=0.01, RDNS_DYNAMIC=0.982, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, TO_NO_BRKTS_DYNIP=0.001 autolearn=no autolearn_force=no X-Spam_action: no action X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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 Exit with a friendlier error message instead of throwing throwing a “failed with signal 11” error if ‘svn’ isn’t in the user’s PATH. $ guix import texlive getmap command "svn" "export" "--non-interactive" "--trust-server-cert" "-r" "59745" "svn://www.tug.org/texlive/tags/texlive-2021.3/Master/texmf-dist/doc/latex/getmap/" "/tmp/guix-directory.YgfGgo/doc/latex/getmap/" failed with signal 11 * doc/guix.texi (Invoking guix import): Mention that Subversion has be installed. * guix/import/texlive.scm (tlpdb->package): Check if ‘svn’ is found in PATH, if not exit with an error message. --- doc/guix.texi | 4 +++- guix/import/texlive.scm | 7 +++++++ 2 files changed, 10 insertions(+), 1 deletion(-) base-commit: 87e5502d406bfb44b61f7577b241602e02a3498e diff --git a/doc/guix.texi b/doc/guix.texi index 333cb4117a..1ece51de81 100644 --- a/doc/guix.texi +++ b/doc/guix.texi @@ -12020,7 +12020,9 @@ Information about the package is obtained from the TeX Live package database, a plain text file that is included in the @code{texlive-bin} package. The source code is downloaded from possibly multiple locations -in the SVN repository of the Tex Live project. +in the SVN repository of the Tex Live project. This means that the +@code{subversion} package has to be installed in order for the importer +to work. The command command below imports metadata for the @code{fontspec} TeX package: diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm index bdef9f58b0..e3b870efa0 100644 --- a/guix/import/texlive.scm +++ b/guix/import/texlive.scm @@ -1,6 +1,7 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017, 2021 Ricardo Wurmus ;;; Copyright © 2021 Maxim Cournoyer +;;; Copyright © 2021 Xinglu Chen ;;; ;;; This file is part of GNU Guix. ;;; @@ -37,6 +38,8 @@ (define-module (guix import texlive) #:use-module (guix utils) #:use-module (guix upstream) #:use-module (guix packages) + #:use-module (guix diagnostics) + #:use-module (guix i18n) #:use-module (guix build-system texlive) #:export (texlive->guix-package texlive-recursive-import)) @@ -204,6 +207,10 @@ (define (files->directories files) equal?))) (define (tlpdb->package name package-database) + ;; Check if 'svn' is available. + (unless (search-path (string-split (getenv "PATH") #\:) "svn") + (leave (G_ "the 'svn' program has to be in your PATH~%"))) + (and-let* ((data (assoc-ref package-database name)) (dirs (files->directories (map (lambda (dir)