GNU bug report logs -
#66082
[PATCH v2 15/23] DRAFT import: juliahub: Add support for versions for juliahub-fetch.
Previous Next
Reported by: Simon Tournier <zimon.toutoune <at> gmail.com>
Date: Mon, 18 Sep 2023 18:06:08 UTC
Severity: normal
Tags: patch
Merged with 66075,
66076,
66077,
66078,
66079,
66080,
66081,
66083,
66084,
66085,
66086,
66087,
66088,
66089,
66090,
66091,
66092
Done: Simon Tournier <zimon.toutoune <at> gmail.com>
Bug is archived. No further changes may be made.
To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 66082 in the body.
You can then email your comments to 66082 AT debbugs.gnu.org in the normal way.
Toggle the display of automated, internal messages from the tracker.
Report forwarded
to
guix-patches <at> gnu.org
:
bug#66082
; Package
guix-patches
.
(Mon, 18 Sep 2023 18:06:08 GMT)
Full text and
rfc822 format available.
Acknowledgement sent
to
Simon Tournier <zimon.toutoune <at> gmail.com>
:
New bug report received and forwarded. Copy sent to
guix-patches <at> gnu.org
.
(Mon, 18 Sep 2023 18:06:08 GMT)
Full text and
rfc822 format available.
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
From: Nicolas Graves via Guix-patches via <guix-patches <at> gnu.org>
Signed-off-by: Simon Tournier <zimon.toutoune <at> gmail.com>
---
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 b646f9329562..6ce0487dba38 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 <juliahub-package> 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.38.1
bug closed, send any further explanations to
66082 <at> debbugs.gnu.org and Simon Tournier <zimon.toutoune <at> gmail.com>
Request was from
Simon Tournier <zimon.toutoune <at> gmail.com>
to
control <at> debbugs.gnu.org
.
(Mon, 18 Sep 2023 21:01:07 GMT)
Full text and
rfc822 format available.
bug archived.
Request was from
Debbugs Internal Request <help-debbugs <at> gnu.org>
to
internal_control <at> debbugs.gnu.org
.
(Tue, 17 Oct 2023 11:24:10 GMT)
Full text and
rfc822 format available.
This bug report was last modified 1 year and 206 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.