From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp12.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms9.migadu.com with LMTPS id 0IvWLLalRmRxLAEASxT56A (envelope-from ) for ; Mon, 24 Apr 2023 17:52:22 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp12.migadu.com with LMTPS id uFTLLLalRmTcTAAAauVa8A (envelope-from ) for ; Mon, 24 Apr 2023 17:52:22 +0200 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 8F3E8377B8 for ; Mon, 24 Apr 2023 17:52:22 +0200 (CEST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pqyU6-0000Cw-DM; Mon, 24 Apr 2023 11:52:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pqyTz-0008WR-Tx for guix-patches@gnu.org; Mon, 24 Apr 2023 11:52:04 -0400 Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pqyTz-0005C2-Bz for guix-patches@gnu.org; Mon, 24 Apr 2023 11:52:03 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pqyTz-0006t8-8O for guix-patches@gnu.org; Mon, 24 Apr 2023 11:52:03 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#63053] [PATCH 2/3] scripts: import: crate: Handle non-existent package. Resent-From: Simon Tournier Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 24 Apr 2023 15:52:03 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 63053 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 63053@debbugs.gnu.org Cc: Simon Tournier Received: via spool by 63053-submit@debbugs.gnu.org id=B63053.168235149726412 (code B ref 63053); Mon, 24 Apr 2023 15:52:03 +0000 Received: (at 63053) by debbugs.gnu.org; 24 Apr 2023 15:51:37 +0000 Received: from localhost ([127.0.0.1]:50166 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqyTZ-0006rr-5h for submit@debbugs.gnu.org; Mon, 24 Apr 2023 11:51:37 -0400 Received: from mail-wr1-f41.google.com ([209.85.221.41]:40292) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pqyTW-0006qm-7j for 63053@debbugs.gnu.org; Mon, 24 Apr 2023 11:51:35 -0400 Received: by mail-wr1-f41.google.com with SMTP id ffacd0b85a97d-2f45377dcc7so687695f8f.1 for <63053@debbugs.gnu.org>; Mon, 24 Apr 2023 08:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682351488; x=1684943488; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=Mrsont0v00oPoNeY3cFDzUsCBq0kgs8M2JzhiDFSfQM=; b=F2T6vF1oB+j3ljPa7JeM7dVPwcGyEhaXz7XygtmCfN3vtqZ28C+7F0q3gzsGYnIMvC g2wepuGeAp2L/rZ1OMMkFs8qIRhHauTVqtjeXOe8nhrnZOWO4H99EKPV3Pl2nwL59Hvb QTppbtXM+RyQBxjgoom42BTL9KDKi2nOlE0Z3zrdUDlRA+5G41IHyajBw20ciU6P0Ftw XTopunoFrjthuAQCx+ArzpALtf6HeXBJzg9+PBOPeDqmKVPe71JS9tOE1Mf4bhJ3z+LQ xYDEp6gBS4Dd/mZDRAH1omHexvaLaIa5mlekQsDQxHzWGxyxO4HYFbYGAlL1krRuuYLO qhrg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682351488; x=1684943488; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=Mrsont0v00oPoNeY3cFDzUsCBq0kgs8M2JzhiDFSfQM=; b=SKWfu7qHRJfyGnRuR7QRTQ2c6i9iRbJxlB8Ist5B0e3C6muGzMDIJ73qpBS08iRGwS 2meuiwhtdLJe8mJ/jYPi6ZjM4WU4E71baYDtXlUaenybw4U9asX/w7vQWlA96uG0bNI1 atXszYsOVth9QkdvUedospU+sNxnEsCdhZThUzJP6TC2qCu7bKdBCHrUP3SwnN5vvuqR pR4gHe6pjG7LKDw9EfvBO3cAd/hTGLnJmDw5Gepd2sJy7fO3AFhOceqggi0hLQCnPHNj zKmS/j61BK0fH54YzAgnnICZhqXHvnK+KJzZInjy+wmsBll+QDmrC9v4bxn4L7kriWz9 0vGQ== X-Gm-Message-State: AAQBX9dQo0tHnKdMxYMyiX6BFONJIWpqHNJyLXa5FFbR1A4xdS34bmIE uemqIporKd9orm+4vCB4Jivls8FBXks= X-Google-Smtp-Source: AKy350YT4YSx9PSeXrsBDkbCXyhkardKyaJlAPNxXhH98EMWm0f/yZLxCUXSZzvwbZmFRq+WD7h6WA== X-Received: by 2002:a5d:56cb:0:b0:2fc:1d2e:dc91 with SMTP id m11-20020a5d56cb000000b002fc1d2edc91mr7495247wrw.0.1682351488123; Mon, 24 Apr 2023 08:51:28 -0700 (PDT) Received: from localhost.localdomain ([193.48.40.241]) by smtp.gmail.com with ESMTPSA id e5-20020a5d5305000000b002cf1c435afcsm11109853wrv.11.2023.04.24.08.51.27 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 24 Apr 2023 08:51:27 -0700 (PDT) From: Simon Tournier Date: Mon, 24 Apr 2023 17:51:18 +0200 Message-Id: <20230424155119.1540974-2-zimon.toutoune@gmail.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230424155119.1540974-1-zimon.toutoune@gmail.com> References: <20230424155119.1540974-1-zimon.toutoune@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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+larch=yhetil.org@gnu.org Sender: guix-patches-bounces+larch=yhetil.org@gnu.org X-Migadu-Country: US X-Migadu-Flow: FLOW_IN ARC-Seal: i=1; s=key1; d=yhetil.org; t=1682351542; a=rsa-sha256; cv=none; b=LBrqR4PdvlgeSpOfxi6g1kr86HWnJhWaIdNhigAkyzBLtiyOa0dDUkcHHuZUuqP2X8OQKS Dvk7c/wJ57Rwl5Q/b7eWUM2PDAlWegQtL720tbwJsd4MpQZ9mi5sd6VWMTzvigxUfnZc/L TMnjFEuScJRb2WbdhJak+Xn82IEEdsunm8vV0vgtkHGe27oKCkFW78YwusiykxVtXVRLxA k6/xQ7O7hJ9RbRNDuiR6F7shRiOVGB3tCNVTlg0R2bd9nvlifPCo4T1HjvnC4zdrHBeny2 nLJAEUhfvWqc+lFt1k+B7zbRnmNZabj45s5SllRvhnA5Hrhtqq9E5jp//3mT3A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=F2T6vF1o; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1682351542; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post:dkim-signature; bh=Mrsont0v00oPoNeY3cFDzUsCBq0kgs8M2JzhiDFSfQM=; b=W2IV7L7RNOB+DE8lZrPL7nuvO+ePmGF0w4p1VdgkesO7G4Dx1PIrxDZIcjX5GBEUKtCKY3 HzcP+ilemO1BaVctymx/4gFc7yMxEE6lezyLRfoNI0pbskJvTV68SsTJD0vylG8vXvuPQ4 y/UToTKOGd4XRckDF5CAgSMPMIITr9283CYrtX8hle+ES6OC2x9A1Wjt5i4b4Ek5YMP1MD 4SzMLIg4phzgxP8oX0nnH/G64E6ItGRXGHJPhVCCYjg+LsrZYyQQZDRiERkXbZB9HavDOb LYJSuQ8G+A630fWPgM8jukw1odY5B3T2jXAFX/761AxJeSuANnAUKTas3AHu2w== X-Migadu-Spam-Score: -0.31 X-Spam-Score: -0.31 X-Migadu-Queue-Id: 8F3E8377B8 X-Migadu-Scanner: scn0.migadu.com Authentication-Results: aspmx1.migadu.com; dkim=fail ("headers rsa verify failed") header.d=gmail.com header.s=20221208 header.b=F2T6vF1o; dmarc=fail reason="SPF not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (aspmx1.migadu.com: domain of "guix-patches-bounces+larch=yhetil.org@gnu.org" designates 209.51.188.17 as permitted sender) smtp.mailfrom="guix-patches-bounces+larch=yhetil.org@gnu.org" X-TUID: BhujXld6oJUH Fixes . * guix/scripts/import/crate.scm (guix-import-crate): Handle non-existent package input. --- guix/scripts/import/crate.scm | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/guix/scripts/import/crate.scm b/guix/scripts/import/crate.scm index 97152904ac..038faa87db 100644 --- a/guix/scripts/import/crate.scm +++ b/guix/scripts/import/crate.scm @@ -4,6 +4,7 @@ ;;; Copyright © 2016 David Craven ;;; Copyright © 2019, 2020 Martin Becze ;;; Copyright © 2021 Sarah Morgensen +;;; Copyright © 2023 Simon Tournier ;;; ;;; This file is part of GNU Guix. ;;; @@ -90,15 +91,16 @@ (define (parse-options) (define-values (name version) (package-name->name+version spec)) - (if (assoc-ref opts 'recursive) - (crate-recursive-import name #:version version) - (let ((sexp (crate->guix-package name #:version version #:include-dev-deps? #t))) - (unless sexp - (leave (G_ "failed to download meta-data for package '~a'~%") - (if version - (string-append name "@" version) - name))) - (list sexp)))) + (match (if (assoc-ref opts 'recursive) + (crate-recursive-import name #:version version) + (crate->guix-package name #:version version #:include-dev-deps? #t)) + ((or #f '()) + (leave (G_ "failed to download meta-data for package '~a'~%") + (if version + (string-append name "@" version) + name))) + ((? list? sexps) sexps) + (sexp (list sexp)))) (() (leave (G_ "too few arguments~%"))) ((many ...) -- 2.38.1