From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp0 ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by ms0.migadu.com with LMTPS id VnZTLAvCzWAwmQAAgWs5BA (envelope-from ) for ; Sat, 19 Jun 2021 12:08:11 +0200 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp0 with LMTPS id AKRIJwvCzWCXIgAA1q6Kng (envelope-from ) for ; Sat, 19 Jun 2021 10:08:11 +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 F0CCB1CC2E for ; Sat, 19 Jun 2021 12:08:10 +0200 (CEST) Received: from localhost ([::1]:46580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1luXtZ-0005zr-TH for larch@yhetil.org; Sat, 19 Jun 2021 06:08:09 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44772) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luXtT-0005zc-2p for guix-patches@gnu.org; Sat, 19 Jun 2021 06:08:03 -0400 Received: from debbugs.gnu.org ([209.51.188.43]:47048) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1luXtS-00015t-Ru for guix-patches@gnu.org; Sat, 19 Jun 2021 06:08:02 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1luXtS-0000pT-KC for guix-patches@gnu.org; Sat, 19 Jun 2021 06:08:02 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#49112] [PATCH] import: launchpad: Use repository to retrieve releases. Resent-From: Matthew James Kraai Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sat, 19 Jun 2021 10:08:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 49112 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 49112@debbugs.gnu.org Cc: Matthew James Kraai X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.16240972713168 (code B ref -1); Sat, 19 Jun 2021 10:08:02 +0000 Received: (at submit) by debbugs.gnu.org; 19 Jun 2021 10:07:51 +0000 Received: from localhost ([127.0.0.1]:58594 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luXtG-0000p2-Td for submit@debbugs.gnu.org; Sat, 19 Jun 2021 06:07:51 -0400 Received: from lists.gnu.org ([209.51.188.17]:34084) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1luXtF-0000ou-3z for submit@debbugs.gnu.org; Sat, 19 Jun 2021 06:07:49 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:44744) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luXtE-0005zE-VC for guix-patches@gnu.org; Sat, 19 Jun 2021 06:07:48 -0400 Received: from mail.ftbfs.org ([52.8.68.13]:19668 helo=aws.ftbfs.org) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1luXtD-0000sJ-B2 for guix-patches@gnu.org; Sat, 19 Jun 2021 06:07:48 -0400 Received: from ip68-228-72-85.oc.oc.cox.net ([68.228.72.85] helo=localhost.localdomain) by aws.ftbfs.org with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1luXtB-00033y-CD; Sat, 19 Jun 2021 10:07:45 +0000 From: Matthew James Kraai Date: Sat, 19 Jun 2021 03:07:39 -0700 Message-Id: <20210619100739.11713-1-kraai@ftbfs.org> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=52.8.68.13; envelope-from=kraai@ftbfs.org; helo=aws.ftbfs.org X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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+larch=yhetil.org@gnu.org Sender: "Guix-patches" X-Migadu-Flow: FLOW_IN ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=yhetil.org; s=key1; t=1624097291; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding:resent-cc: resent-from:resent-sender:resent-message-id:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=UzXBladl8k+wjj+nfgpqBXw+V5c7N/AIqbat2OXCYLE=; b=vCYvd69L7f7IVeIcmoCC4hbOC3h3HZCR+HocMJnjOZKeWrzcAjMCfJMZ1FA4D+1DncUOan stc+AVvL8Tk3FxptFeZQKlC06i9HVNgi01kKEweHHaNH0ZdIiIPEONW8NSHZOhTMxSmaeN 7MgKiH2uJWVIgGSRWJofbMjkl2CZBcddMVopHHXw9QsCbXsE3DMRr1lQKWDWyMPDkzITXV 6ilZycsOi1qDWUjRTLPYEDyLzOhryuFvOU6MRdJ8ypFdODSxlAJs780VA+HsOlA2jVmlQd milfylLw118dDXeaPvDequ3bzhtJ8i8x7ro3Ev491AWPXLeg7gGJjGEilactrg== ARC-Seal: i=1; s=key1; d=yhetil.org; t=1624097291; a=rsa-sha256; cv=none; b=Y1LZcwYE811VBK5DFLUGASGUXxmCpNORqqLrk+tTSUa7Yzr6vWqfhj+xxvva3RUIGgzf2i mv+oQXy+z/MckUGYAiDJoRJ9sBq28MYwDeKLOOb+Qr4urDEPYuSx6moAMGKXYisrgi8HzU 17VO7ZOpCwXXNzTgrr4uvWzZWvQvdCrR04GbkxJp+zzeGb9cebPGtE19YGGcnqIBSTEFIv DHVochpCK/NjV1SM+l1vxga0LMCxrMEDPNR75OLAv8giQi79irbOWzfz1Jv5P351g0BRLy c4lqt/+0QK9AUzeSj1X1n2z9BAEGNXGSzROQ8DXzZ9ToKUHdPQPht0igi14JLQ== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Spam-Score: 2.58 Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=none; spf=pass (aspmx1.migadu.com: domain of guix-patches-bounces@gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=guix-patches-bounces@gnu.org X-Migadu-Queue-Id: F0CCB1CC2E X-Spam-Score: 2.58 X-Migadu-Scanner: scn0.migadu.com X-TUID: AUi/rxHqAEP/ * guix/import/launchpad.scm (latest-released-version): Use repository instead of package name. (latest-release): Pass repository to latest-released-version. --- guix/import/launchpad.scm | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/guix/import/launchpad.scm b/guix/import/launchpad.scm index a52b39a085..23ac6a3c7b 100644 --- a/guix/import/launchpad.scm +++ b/guix/import/launchpad.scm @@ -100,8 +100,8 @@ URL of the form (match (string-split (uri-path (string->uri url)) #\/) ((_ repo . rest) repo))) -(define (latest-released-version package-name) - "Return a string of the newest released version name given the PACKAGE-NAME, +(define (latest-released-version repository) + "Return a string of the newest released version name given the REPOSITORY, for example, 'linuxdcpp'. Return #f if there is no releases." (define (pre-release? x) ;; Versions containing anything other than digit characters and "." (for @@ -112,7 +112,7 @@ for example, 'linuxdcpp'. Return #f if there is no releases." (match (json-fetch (string-append "https://api.launchpad.net/1.0/" - package-name "/releases")) + repository "/releases")) (#f #f) ;404 or similar (json (assoc-ref @@ -129,7 +129,8 @@ for example, 'linuxdcpp'. Return #f if there is no releases." (let* ((source-uri (origin-github-uri (package-source pkg))) (name (package-name pkg)) - (newest-version (latest-released-version name))) + (repository (launchpad-repository source-uri)) + (newest-version (latest-released-version repository))) (if newest-version (upstream-source (package name) -- 2.32.0