From patchwork Sun Aug 28 13:18:39 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Hartmut Goebel X-Patchwork-Id: 42032 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 5199C27BBEA; Sun, 28 Aug 2022 14:21:01 +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 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 0823827BBE9 for ; Sun, 28 Aug 2022 14:21:01 +0100 (BST) Received: from localhost ([::1]:50166 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oSIDk-0004ZM-6S for patchwork@mira.cbaines.net; Sun, 28 Aug 2022 09:21:00 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59412) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oSICv-0002wf-4M for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:09 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:39842) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oSICu-0002fr-QX for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:08 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oSICu-0006yy-Ma for guix-patches@gnu.org; Sun, 28 Aug 2022 09:20:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#57460] [PATCH 13/20] refresh: Allow updating to a specific version (launchpad) Resent-From: Hartmut Goebel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 28 Aug 2022 13:20:08 +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.166169278026672 (code B ref 57460); Sun, 28 Aug 2022 13:20:08 +0000 Received: (at 57460) by debbugs.gnu.org; 28 Aug 2022 13:19:40 +0000 Received: from localhost ([127.0.0.1]:57800 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSICS-0006w2-0t for submit@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:40 -0400 Received: from mout.kundenserver.de ([212.227.126.134]:55779) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oSICD-0006uV-4k for 57460@debbugs.gnu.org; Sun, 28 Aug 2022 09:19:25 -0400 Received: from hermia.goebel-consult.de ([46.87.137.46]) by mrelayeu.kundenserver.de (mreue009 [212.227.15.167]) with ESMTPSA (Nemesis) id 1MBDva-1oZOwb2E4E-00Cf86 for <57460@debbugs.gnu.org>; Sun, 28 Aug 2022 15:19:19 +0200 Received: from lenashee.fritz.box (lenashee.goebel-consult.de [192.168.110.2]) by hermia.goebel-consult.de (Postfix) with ESMTP id 3300665A44; Sun, 28 Aug 2022 15:18:56 +0200 (CEST) From: Hartmut Goebel Date: Sun, 28 Aug 2022 15:18:39 +0200 Message-Id: X-Mailer: git-send-email 2.30.4 In-Reply-To: References: MIME-Version: 1.0 X-Provags-ID: V03:K1:7uVrN269qPlYhoB5DRN6/lf4fPiM2x0jjUxhiaPg3y+7Uz6FQHX rS0z33+XcHJ8sbSd4D4BSzvfm1+796aVme74EQNJaU90psqQmT6N+2/8qtmzSX6qg2CBQcB FGV8G77/jJGLRJ2Hx5MS5aY/oiLvvo2Vp+xi/K116DRCs2vmyOxmXqklYXMiispIgtlg4a+ yBVlAl5xUcY4byaiETlag== X-UI-Out-Filterresults: notjunk:1;V03:K0:A6MP/1+1JXo=:bPOcaFlU/IF/PzmcYQGt7D fFnZSta+XO9j7aKcryxfp/nzO7eJqmWoyhR869GtU681uRQ1h0nd4zGHk9FzfhUnA8kN18UJv lsAKn1Y5O5/22lvT/dEjke99/iWFjSG2d1BgBgwju3XdbP//2X8dF1THeJlOvxUrofSdytsgt YDtVqXTowZr5smknf5HhAVahXE50h4wnvKxRcgAAJZPeQlnWghImDgjCjt00HHOHuNo6EnJYS Pxw4ouOJG834lAfbeSCp1RwSPR8U8uF/tICI4n7k+u8WbntEIqY31zrbZegbm52wGFDZ8Qlno k+HAkrIr/x4qiptRn6XUaiFJUHGtRu4OSIFR8PURJddn8OH2MVOYmDXNQMCyCncik6TK0/TBb 7lV2G52nwXUUDvftH8C1Ik1eA53YNqKWW6oHGk7NJKhYuRXOjic86Kq1/XNTK78H8ChlE0UWN 1Ge8XP1cBptA9tJmI0hpwjj+4uTAhrtlgfTDzkD1vCGXMdHm5tpisESnMWcoDRlHbxQu01LWo nZIdwhm1HsiOWo246FwbSqw3Is+8qhXWq3AvlaiSpZia3Z/U/jShogHYAfS9/mTbXLLHwv30h 3d+c8UjnLLS/EKGrjJrzr0RzWk3fp+9z4c6Au0Hzw2k/LGSOHZtk2h0aP1kdQyHXzgc0TERcv 7jfxi9oJlDwUW/hgI/zhsC2NMK3T51n/tbGUgNQRxH+aBZ40mHhX7AdrT6qcZEDveeMbbWnjA tCU7N8K5bNGS0OTRyzSAwbwaT5Qfz4j27Hz135j667T/V+2qQVYPjf7K4IY= 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/launchpad.scm(latest-release): Rename to (import-release), add keyword-argument 'version'. If version is given, return an upstream-source for this version. --- guix/import/launchpad.scm | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm index b7e0295c4e..2112eefe1d 100644 --- a/guix/import/launchpad.scm +++ b/guix/import/launchpad.scm @@ -2,6 +2,7 @@ ;;; Copyright © 2019, 2020 Arun Isaac ;;; Copyright © 2021 Matthew James Kraai ;;; Copyright © 2020 Brice Waegeneire +;;; Copyright © 2022 Hartmut Goebel ;;; ;;; This file is part of GNU Guix. ;;; @@ -121,7 +122,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases." (last (remove pre-release? (vector->list (assoc-ref json "entries")))) "version")))) -(define (latest-release pkg) +(define* (import-release pkg #:key (version #f)) "Return an for the latest release of PKG." (define (origin-launchpad-uri origin) (match (origin-uri origin) @@ -132,7 +133,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases." (let* ((source-uri (origin-launchpad-uri (package-source pkg))) (name (package-name pkg)) (repository (launchpad-repository source-uri)) - (newest-version (latest-released-version repository))) + (newest-version (or version (latest-released-version repository)))) (if newest-version (upstream-source (package name) @@ -145,4 +146,4 @@ for example, 'linuxdcpp'. Return #f if there is no releases." (name 'launchpad) (description "Updater for Launchpad packages") (pred launchpad-package?) - (import latest-release))) + (import import-release)))