From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp2 ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms11 with LMTPS id UKIqLrpn819+VAAA0tVLHw (envelope-from ) for ; Mon, 04 Jan 2021 19:08:42 +0000 Received: from aspmx1.migadu.com ([2001:41d0:2:4a6f::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp2 with LMTPS id 2CMHKrpn81+OEQAAB5/wlQ (envelope-from ) for ; Mon, 04 Jan 2021 19:08:42 +0000 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by aspmx1.migadu.com (Postfix) with ESMTPS id 1C35594030E for ; Mon, 4 Jan 2021 19:08:42 +0000 (UTC) Received: from localhost ([::1]:36032 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kwVDb-00055k-Hc for larch@yhetil.org; Mon, 04 Jan 2021 14:08:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:34458) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kwVD0-000550-BC for bug-guix@gnu.org; Mon, 04 Jan 2021 14:08:03 -0500 Received: from debbugs.gnu.org ([209.51.188.43]:48774) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kwVD0-00059y-3W for bug-guix@gnu.org; Mon, 04 Jan 2021 14:08:02 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1kwVCz-0006pD-Tg for bug-guix@gnu.org; Mon, 04 Jan 2021 14:08:01 -0500 X-Loop: help-debbugs@gnu.org Subject: bug#45656: [PATCH] import: texlive: Produce a partial package definition rather than crashing. References: <87ft3geifh.fsf@gmail.com> In-Reply-To: <87ft3geifh.fsf@gmail.com> Resent-From: Maxim Cournoyer Original-Sender: "Debbugs-submit" Resent-CC: bug-guix@gnu.org Resent-Date: Mon, 04 Jan 2021 19:08:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 45656 X-GNU-PR-Package: guix X-GNU-PR-Keywords: To: 45656@debbugs.gnu.org Received: via spool by 45656-submit@debbugs.gnu.org id=B45656.160978725226198 (code B ref 45656); Mon, 04 Jan 2021 19:08:01 +0000 Received: (at 45656) by debbugs.gnu.org; 4 Jan 2021 19:07:32 +0000 Received: from localhost ([127.0.0.1]:60320 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwVCV-0006oU-L8 for submit@debbugs.gnu.org; Mon, 04 Jan 2021 14:07:31 -0500 Received: from mail-qt1-f172.google.com ([209.85.160.172]:33821) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1kwVCT-0006oG-E4 for 45656@debbugs.gnu.org; Mon, 04 Jan 2021 14:07:30 -0500 Received: by mail-qt1-f172.google.com with SMTP id 7so19261352qtp.1 for <45656@debbugs.gnu.org>; Mon, 04 Jan 2021 11:07:29 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dvwDUTYWLNxt7R3wTlkbvd3hSdCmBp3KeMI6MEdIGF0=; b=gCZbn6AzBfy7i19YoqudRrOaZFH8c2Xg6CKLXtjUruKcgyCB9MjUBUIfKSJG23YLMM itb9LNglKxL19HXsQsViQxBTzqYNSvhfFVe3F2j+2sAVysIWd4zu0537aTX5v/XxFm8G LNiEnvSjZW9WMxxHcunpTOUXpC0UdiX33fwN1P6wCKwGt854OO5qxuYZr8xzMracbAeA 8iQSzvnETuYfh2DGYGLi9o9/XnM2zOuaRZ+A9i17lSBOvMarxkeuPrDMaC5G8ycsothl z2eObWpD0AAODqi99t0lIN3o3OETRLjmD/fqeQTOblfPjzP6YqZww62fT3H8K9xeAkZO JTGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=dvwDUTYWLNxt7R3wTlkbvd3hSdCmBp3KeMI6MEdIGF0=; b=oRVlCEYL9kRn96pCa2DwTrtmou/SJRmtgGLPEpdOFtx5qLTCxgzzf3XozY/1egW3JN LO9y6FyiMIOwoJ1zWpX5RLxy/sUgMxGIvycuBWxq7nu6EUomcQEasnU60WcsMgkxkEvt bjvnUuHPosgtGN+1iZyissPrjzCqxpKMx0AH8q4acbQPjoUYYGYmN4HcBc3vDgKDeWmJ E4V2CJIn1AyEVRG14kyI3KIAdFf1Gos5E96A+NYvm8OT6NgoruMwgYYXRrbCHk23mtFB mFA8QnOH1Dx/B8iwfxyEfh5kPxFMnOCTetBQE3PBOMsgTRyKoUHqs7o858n01H10n2bk 5erw== X-Gm-Message-State: AOAM532HPOz/VfpCQwVHSdZKHjcu44VOTszOe1eQl/39uBLtLBuUme4t Qf4qghcWmUkOdlfkw1aCSrFWxJj2Dic= X-Google-Smtp-Source: ABdhPJycfd6nITpqkzWNlbEYrniZVhKh3MydYUd8p6UOi5yhrfCLW6erX0zJTNc8ZeDlFgONaGaQ8Q== X-Received: by 2002:aed:2ba5:: with SMTP id e34mr74525234qtd.146.1609787243798; Mon, 04 Jan 2021 11:07:23 -0800 (PST) Received: from localhost.localdomain (dsl-153-224.b2b2c.ca. [66.158.153.224]) by smtp.gmail.com with ESMTPSA id r25sm37560774qtu.88.2021.01.04.11.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 04 Jan 2021 11:07:23 -0800 (PST) From: Maxim Cournoyer Date: Mon, 4 Jan 2021 14:06:45 -0500 Message-Id: <20210104190645.7693-1-maxim.cournoyer@gmail.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Content-Type: text/plain; charset=yes Content-Transfer-Encoding: 8bit X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-guix@gnu.org List-Id: Bug reports for GNU Guix List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Maxim Cournoyer Errors-To: bug-guix-bounces+larch=yhetil.org@gnu.org Sender: "bug-Guix" X-Migadu-Flow: FLOW_IN X-Migadu-Spam-Score: -1.23 Authentication-Results: aspmx1.migadu.com; dkim=fail (headers rsa verify failed) header.d=gmail.com header.s=20161025 header.b=gCZbn6Az; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of bug-guix-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=bug-guix-bounces@gnu.org X-Migadu-Queue-Id: 1C35594030E X-Spam-Score: -1.23 X-Migadu-Scanner: scn0.migadu.com X-TUID: nkqdBmj1klzv This is a small improvement awaiting a definitive fix for . * guix/import/texlive.scm (sxml->package): Produce a warning when the SVN checkout failed. Rather than crashing on the unexpected #f value, return a partial package definition with the source field set to #f. --- guix/import/texlive.scm | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/guix/import/texlive.scm b/guix/import/texlive.scm index a84683ef6f..ba04a74d0f 100644 --- a/guix/import/texlive.scm +++ b/guix/import/texlive.scm @@ -1,5 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU ;;; Copyright © 2017 Ricardo Wurmus +;;; Copyright © 2020 Maxim Cournoyer ;;; ;;; This file is part of GNU Guix. ;;; @@ -25,6 +26,8 @@ #:use-module (srfi srfi-26) #:use-module (srfi srfi-34) #:use-module (web uri) + #:use-module (guix diagnostics) + #:use-module (guix i18n) #:use-module (guix http-client) #:use-module (gcrypt hash) #:use-module (guix memoization) @@ -147,21 +150,26 @@ expression describing it." ((license) (string->license license)) ((lst ...) (map string->license lst)))) (home-page (string-append "http://www.ctan.org/pkg/" id)) - (ref (texlive-ref component id)) - (checkout (download-svn-to-store store ref))) + (ref (pk (texlive-ref (pk 'component component) (pk 'id id)))) + (checkout (pk 'download (download-svn-to-store store ref)))) + (unless checkout + (warning (G_ "Could not determine source location. \ +Please manually specify the source field.~%"))) `(package (name ,(guix-name component id)) (version ,version) - (source (origin - (method svn-fetch) - (uri (texlive-ref ,component ,id)) - (sha256 - (base32 - ,(bytevector->nix-base32-string - (let-values (((port get-hash) (open-sha256-port))) - (write-file checkout port) - (force-output port) - (get-hash))))))) + (source ,(if checkout + `(origin + (method svn-fetch) + (uri (texlive-ref ,component ,id)) + (sha256 + (base32 + ,(bytevector->nix-base32-string + (let-values (((port get-hash) (open-sha256-port))) + (write-file checkout port) + (force-output port) + (get-hash)))))) + #f)) (build-system texlive-build-system) (arguments ,`(,'quote (#:tex-directory ,(string-join (list component id) "/")))) (home-page ,home-page) -- 2.29.2