From patchwork Sun Aug 28 13:18:32 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 42024 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 B020827BBEB; Sun, 28 Aug 2022 14:20:34 +0100 (BST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.9 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, SPF_HELO_PASS,URIBL_BLOCKED autolearn=unavailable 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 1F6A327BBE9 for ; Sun, 28 Aug 2022 14:20:34 +0100 (BST) Received: from localhost ([::1]:59254 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSIDJ-0002sn-9J for patchwork@mira.cbaines.net; Sun, 28 Aug 2022 09:20:33 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:49044) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSICr-0002nN-Od for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:05 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39835) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSICr-0002eM-F6 for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:05 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSICr-0006y7-AP for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:05 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57460] [PATCH 06/20] refresh: Allow updating to a specific version (crate) Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Aug 2022 13:20:05 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57460 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 57460@debbugs.gnu.org Received: via spool by 57460-submit@debbugs.gnu.org id=B57460.166169275826538 (code B ref 57460); Sun, 28 Aug 2022 13:20:05 +0000 Received: (at 57460) by debbugs.gnu.org; 28 Aug 2022 13:19:18 +0000 Received: from localhost ([127.0.0.1]:57776 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSIC5-0006tt-WB for submit@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:18 -0400 Received: from mout.kundenserver.de ([212.227.17.13]:40735) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSIBw-0006sh-U1 for 57460@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:09 -0400 Received: from hermia.goebel-consult.de ([46.87.137.46]) by mrelayeu.kundenserver.de (mreue109 [212.227.15.183]) with ESMTPSA (Nemesis) id 1MeCxd-1p1u7c1FQ7-00bJ9q for <57460@debbugs.gnu.org>; Sun, 28 Aug 2022 15:19:03 +0200 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id A47D265A36; Sun, 28 Aug 2022 15:18:55 +0200 (CEST) From: Hartmut Goebel Date: Sun, 28 Aug 2022 15:18:32 +0200 Message-Id: <389c12814d8768fbdd34772442c48c8fa2aa5690.1661691694.git.h.goebel@crazy-compilers.com> X-Mailer: git-send-email 2.30.4 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:RlKTLacXSbDhwDkQPZOSEQxVbi7lorGgLup1JXlCj7wSJ1wTNqt 3GKdqhOsMnXWXneKIG6wv87QhMqaHIXq7kFZX0uDni9wgxuBSwGWHdV9UOx5DkROkPwaa/B t3yDFKWn+RuCpdjGTwEwn+Qm0gAXPBxfBBJKRvtiOIxzaO6W/qHU3z7GqkiCXJSQe3BPGhs Lt01EA2tvoseTa1KqnYuA== X-UI-Out-Filterresults: notjunk:1;V03:K0:eVMjIaqKPtg=:q18e9rQOwnkPnCil1ZJEHH ivb9VqqCA7mHRMyNYkEIjWueRZAY7n7jTh8GByBz26KXleLfcOq3KIKDVOeCgq1WxV+MMJV0f ts1lIjb/EVysVflXw2UGoRKRb101Ws8JOsZD+7odwaMCPAk4Mcu6pWHKG5b2GQzC0lIYeaVB/ QDjd1sBrD0z7ZPxncPlz+VkhloxkbVFALrXap1QIIrvIeAj1nTZJ/+C8C5Tq2Gub0bFXnQJUY +t4rz+gU/d3t1LObBxxwCVWGRl4dj6dkdpTN2FporidEAXYeGI6JbZR4iB+aYDC2o2zjkqvUW 9U1ty+ITyossRhUjqtILs7lZS0D87zl3tuVzN8557WUBZlBqOZxi/ek7trGvmK3xky6KpPSkf OH6L+vB/B5ozvWNCzeIB+k30ebbxNLHo9rYYtjvd6Jmcd/9eaZhicfVzDPW/Zzu0hsKrkYXJQ CcXkQx2DMJVSlYUliOAA7H4cG6H7DEJlKGbGlvq2fXp1IxFFO5PidkzZLNd1EmfMLCIPxbOY6 cws3MxB0RjextBhfbHYoNgXmW7ftl9mCAm9QhtcB0nm2Akjtb9jfD69rE8XKEI8GyWM9kimU7 wSa0deIIKjuWL1886Mxd+56v9yIuCWyvi3OPWS3JvRxF5nqx0eQzp/AuMhEMEo8rt/5hDilQM OLeFatYzwE88IXgeu4ObZI7MoXduxpqt7sDXyQKPp+rEGDb78B76AOfJj+qWWgtlZbM0vhelQ RAe104fqTGfqwS9omdsmk2fjf8xNzIqhfO/7n0Osi9S4iDa9N5sXBDY8amc= 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 * guix/import/crate.scm(latest-release): Rename to (import-release), add keyword-argument 'version'. If version is given, return an upstream-source for this version. --- guix/import/crate.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guix/import/crate.scm b/guix/import/crate.scm index 51bfcd7bed..339eccd687 100644 --- a/guix/import/crate.scm +++ b/guix/import/crate.scm @@ -3,6 +3,7 @@ ;;; Copyright © 2019, 2020, 2021 Ludovic Courtès ;;; Copyright © 2019, 2020 Martin Becze ;;; Copyright © 2021 Nicolas Goaziou +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -354,11 +355,11 @@ look up the development dependencs for the given crate." (define crate-package? (url-predicate crate-url?)) -(define (latest-release package) +(define* (import-release package #:key (version #f)) "Return an for the latest release of PACKAGE." (let* ((crate-name (guix-package->crate-name package)) (crate (lookup-crate crate-name)) - (version (crate-latest-version crate)) + (version (or version (crate-latest-version crate))) (url (crate-uri crate-name version))) (upstream-source (package (package-name package)) @@ -370,5 +371,5 @@ look up the development dependencs for the given crate." (name 'crate) (description "Updater for crates.io packages") (pred crate-package?) - (import latest-release))) + (import import-release)))