From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mp11.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 wA4PGMi/EWSqFAEASxT56A (envelope-from ) for ; Wed, 15 Mar 2023 13:53:28 +0100 Received: from aspmx1.migadu.com ([2001:41d0:2:bcc0::]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) by mp11.migadu.com with LMTPS id KLAUGMi/EWSXrQAA9RJhRA (envelope-from ) for ; Wed, 15 Mar 2023 13:53:28 +0100 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 1D14939735 for ; Wed, 15 Mar 2023 13:53:28 +0100 (CET) Authentication-Results: aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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=1678884808; h=from:from:sender:sender:reply-to: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:in-reply-to:in-reply-to: references:references:list-id:list-help:list-unsubscribe: list-subscribe:list-post; bh=6/ygbmSOLtwvWrXIMxyWTCf04uO6CrUQaYkFJjS5a60=; b=MVlS6z7BD316dOoIWOOwnvEiJ5/IAwEE40DCWl/AM3gmE9tTFS4kkc8IqTWP2atqEjMis9 OME/wuxk0rallYDuZeKVJ+n+ihjHcmyvhiWC/IOixkoGGfEgHVtoBQ/IqeMimpP/IzMiIj W3ecBF74Z5HS2mSIrLFyUtwdFsPruUBF96Ahd/xeeJvCr9cfqWuCRzOowJSNBksXPZHaRt a637CQzevbfHa2ZmwNqVU8O/qWuurtppvNMIawA3OkSk3odp5yj+yVrdGUv2h2kCICF4uv FZJFOxbzVW9aoSvSWYoltXNHmT7k8tBC0HP26P/YQ4h+2OY9/WxzZJJCFTIm/A== ARC-Authentication-Results: i=1; aspmx1.migadu.com; dkim=none; dmarc=pass (policy=none) header.from=gnu.org; 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-Seal: i=1; s=key1; d=yhetil.org; t=1678884808; a=rsa-sha256; cv=none; b=I1IsQfuMuDhzEY+1rkjtWvz19WCgDUKW3+e0zWp0ZFlkLuan/shhp3vskaK7GUmvF3zscr xWNqyCZZKY1IoNPFF0CwN6p3S85qsY0nPy2fAFdj0dewaA+f4GobdGICDs8HdFNn79vpve 5a7HCGG8A9sdWULHJeO4A7v4GCYUcUQq74H2AEwpsts+LkDo7NkucGmFkllGoqNzbE4MDV 7/t9ACb1UQ/m8DKSd+0XwASAlE+3X7LsrbcUUsYCQCbxuunNUOfwWFfsJogtkx3HX70j0u UOTrseOuEH7PK2eYKyGt3xg6xaY97y+EnFTEDPE3Fh/+bhpCl6xJ38LFxT4gvg== Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pcQc7-0003Y1-Hr; Wed, 15 Mar 2023 08:52:19 -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 1pcQbz-0003RP-5B for guix-patches@gnu.org; Wed, 15 Mar 2023 08:52:11 -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 1pcQbw-00039p-KS for guix-patches@gnu.org; Wed, 15 Mar 2023 08:52:09 -0400 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1pcQbw-0001a9-HD for guix-patches@gnu.org; Wed, 15 Mar 2023 08:52:08 -0400 X-Loop: help-debbugs@gnu.org Subject: [bug#62202] [PATCH 13/21] import: juliahub: Add support for versions for juliahub-fetch. Resent-From: Nicolas Graves Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Wed, 15 Mar 2023 12:52:08 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 62202 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 62202@debbugs.gnu.org Cc: ngraves@ngraves.fr Received: via spool by 62202-submit@debbugs.gnu.org id=B62202.16788847246010 (code B ref 62202); Wed, 15 Mar 2023 12:52:08 +0000 Received: (at 62202) by debbugs.gnu.org; 15 Mar 2023 12:52:04 +0000 Received: from localhost ([127.0.0.1]:39328 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcQbr-0001Yf-W1 for submit@debbugs.gnu.org; Wed, 15 Mar 2023 08:52:04 -0400 Received: from 20.mo582.mail-out.ovh.net ([178.32.124.17]:46657) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1pcQbp-0001Xo-6R for 62202@debbugs.gnu.org; Wed, 15 Mar 2023 08:52:02 -0400 Received: from director2.ghost.mail-out.ovh.net (unknown [10.108.20.16]) by mo582.mail-out.ovh.net (Postfix) with ESMTP id 462B322F9D for <62202@debbugs.gnu.org>; Wed, 15 Mar 2023 12:51:59 +0000 (UTC) Received: from ghost-submission-6684bf9d7b-kqlrr (unknown [10.110.103.53]) by director2.ghost.mail-out.ovh.net (Postfix) with ESMTPS id F23B01FE63; Wed, 15 Mar 2023 12:51:58 +0000 (UTC) Received: from ngraves.fr ([37.59.142.101]) by ghost-submission-6684bf9d7b-kqlrr with ESMTPSA id V7HiOW6/EWSpOhkADUMIIQ (envelope-from ); Wed, 15 Mar 2023 12:51:58 +0000 X-OVh-ClientIp: 81.67.140.142 Date: Wed, 15 Mar 2023 13:51:22 +0100 Message-Id: <20230315125130.23041-13-ngraves@ngraves.fr> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20230315125130.23041-1-ngraves@ngraves.fr> References: <20230315125130.23041-1-ngraves@ngraves.fr> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Ovh-Tracer-Id: 13794244187407901410 X-VR-SPAMSTATE: OK X-VR-SPAMSCORE: 0 X-VR-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedvhedrvddvkedggeegucetufdoteggodetrfdotffvucfrrhhofhhilhgvmecuqfggjfdpvefjgfevmfevgfenuceurghilhhouhhtmecuhedttdenucenucfjughrpefhvfevufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpefpihgtohhlrghsucfirhgrvhgvshcuoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqnecuggftrfgrthhtvghrnhepffelffdtieeijedugffgvddvieetheegveehueeggfegleehleekffehtdeuuefhnecuffhomhgrihhnpehjuhhlihgrhhhusgdrtghomhenucfkphepuddvjedrtddrtddruddpfeejrdehledrudegvddruddtudenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeduvdejrddtrddtrddupdhmrghilhhfrhhomhepoehnghhrrghvvghssehnghhrrghvvghsrdhfrheqpdhnsggprhgtphhtthhopedupdhrtghpthhtohepiedvvddtvdesuggvsggsuhhgshdrghhnuhdrohhrghdpoffvtefjohhsthepmhhoheekvddpmhhouggvpehsmhhtphhouhht 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: , Reply-to: Nicolas Graves X-ACL-Warn: , Nicolas Graves via Guix-patches X-Migadu-Queue-Id: 1D14939735 X-Spam-Score: -2.53 X-Migadu-Spam-Score: -2.53 X-Migadu-Scanner: scn0.migadu.com From: Nicolas Graves via Guix-patches via 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 X-TUID: E63Zu6pqkDtq --- guix/import/juliahub.scm | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/guix/import/juliahub.scm b/guix/import/juliahub.scm index b646f93295..6ce0487dba 100644 --- a/guix/import/juliahub.scm +++ b/guix/import/juliahub.scm @@ -122,7 +122,7 @@ (define %julia-stdlibs "Pkg" "LazyArtifacts")) -(define (juliahub-uri name) +(define (juliahub-redirect-uri name) (let* ((url (string-append "https://docs.juliahub.com/" name "/")) (port (http-fetch url #:text? #t)) (_ (get-line port)) @@ -134,11 +134,11 @@ (define (juliahub-uri name) (define (juliahub-url name) (let* ((url (string-append "https://docs.juliahub.com/" name "/")) - (uri (juliahub-uri name))) + (uri (juliahub-redirect-uri name))) (string-append url uri "/"))) -(define (juliahub-slug-version name) - (let* ((uri (juliahub-uri name)) +(define (juliahub-slug+version name) + (let* ((uri (juliahub-redirect-uri name)) (slug (string-take uri 5)) (latest-version (string-drop uri 6))) `(,slug ,latest-version))) @@ -203,8 +203,12 @@ (define (julia-name->guix-name name) (define* (juliahub-fetch name #:key (version #f)) "Return a record for package NAME, or #f on failure." - (and=> (json-fetch (string-append (juliahub-url name) "pkg.json")) - json->juliahub-package)) + (let ((url (if version + (string-append "https://docs.juliahub.com/" name "/" + (car (juliahub-slug+version name)) "/" + version "/pkg.json") + (string-append (juliahub-url name) "pkg.json")))) + (and=> (json-fetch url) json->juliahub-package))) (define (make-julia-sexp name source home-page synopsis description direct-dependencies test-dependencies-names licenses) @@ -242,9 +246,9 @@ (define* (juliahub->guix-package package-name (subdir (assoc-ref package-toml 'subdir)) (tag (latest-git-tag (assoc-ref package-toml 'repo))) (package (if version - (juliahub-fetch package-name version) + (juliahub-fetch package-name #:version version) (if tag - (juliahub-fetch package-name tag) + (juliahub-fetch package-name #:version tag) (juliahub-fetch package-name))))) (if package (let-values (((source directory) -- 2.39.2