Archived
1
0
Fork 0

gnu-maintenance: Use (htmlprag) for 'latest-html-release'.

* guix/gnu-maintenance.scm (html->sxml): Remove.  Autoload (htmlprag)
instead.
* doc/guix.texi (Requirements): Mention 'guix refresh' for the Guile-Lib
dependency.
This commit is contained in:
Ludovic Courtès 2021-03-13 12:39:34 +01:00
parent 62a091368d
commit 71f6acd28d
No known key found for this signature in database
GPG key ID: 090B11993D9AEBB5
2 changed files with 3 additions and 13 deletions

View file

@ -865,7 +865,8 @@ the @code{crate} importer (@pxref{Invoking guix import}).
@item @item
@uref{https://www.nongnu.org/guile-lib/doc/ref/htmlprag/, Guile-Lib} for @uref{https://www.nongnu.org/guile-lib/doc/ref/htmlprag/, Guile-Lib} for
the @code{go} importer (@pxref{Invoking guix import}). the @code{go} importer (@pxref{Invoking guix import}) and for some of
the ``updaters'' (@pxref{Invoking guix refresh}).
@item @item
When @url{http://www.bzip.org, libbz2} is available, When @url{http://www.bzip.org, libbz2} is available,

View file

@ -38,6 +38,7 @@
#:use-module (guix upstream) #:use-module (guix upstream)
#:use-module (guix packages) #:use-module (guix packages)
#:autoload (zlib) (call-with-gzip-input-port) #:autoload (zlib) (call-with-gzip-input-port)
#:autoload (htmlprag) (html->sxml) ;from Guile-Lib
#:export (gnu-package-name #:export (gnu-package-name
gnu-package-mundane-name gnu-package-mundane-name
gnu-package-copyright-holder gnu-package-copyright-holder
@ -447,18 +448,6 @@ hosted on ftp.gnu.org, or not under that name (this is the case for
;;; Latest HTTP release. ;;; Latest HTTP release.
;;; ;;;
(define (html->sxml port)
"Read HTML from PORT and return the corresponding SXML tree."
(let ((str (get-string-all port)))
(catch #t
(lambda ()
;; XXX: This is the poor developer's HTML-to-XML converter. It's good
;; enough for directory listings at <https://kernel.org/pub> but if
;; needed we could resort to (htmlprag) from Guile-Lib.
(call-with-input-string (string-replace-substring str "<hr>" "<hr />")
xml->sxml))
(const '(html))))) ;parse error
(define (html-links sxml) (define (html-links sxml)
"Return the list of links found in SXML, the SXML tree of an HTML page." "Return the list of links found in SXML, the SXML tree of an HTML page."
(let loop ((sxml sxml) (let loop ((sxml sxml)