gnu-maintenance: Document nested procedures in 'import-html-release'.

* guix/gnu-maintenance.scm (import-html-release): Add docstring to the
'file->signature/guess' and 'url->release' nested procedures.
This commit is contained in:
Maxim Cournoyer 2023-08-10 12:06:05 -04:00
parent c6b5eeac92
commit 2654232660
No known key found for this signature in database
GPG key ID: 1260E46482E63562

View file

@ -514,6 +514,7 @@ (define* (import-html-release base-url package
(string-append base-url directory "/")))
(links (url->links url)))
(define (file->signature/guess url)
"Return the first link that matches a signature extension, else #f."
(let ((base (basename url)))
(any (lambda (link)
(any (lambda (extension)
@ -524,6 +525,8 @@ (define (file->signature/guess url)
links)))
(define (url->release url)
"Return an <upstream-source> object if a release file was found at URL,
else #f."
(let* ((base (basename url))
(base-url (string-append base-url directory))
(url (cond ((and=> (string->uri url) uri-scheme) ;full URL?
@ -574,7 +577,7 @@ (define candidates
(() #f)
((first . _)
(if version
;; find matching release version and return it
;; Find matching release version and return it.
(find (lambda (upstream)
(string=? (upstream-source-version upstream) version))
(coalesce-sources candidates))