diff --git a/lisp/install-abcl-bin.lisp b/lisp/install-abcl-bin.lisp index 06e2d8a..91fd33e 100644 --- a/lisp/install-abcl-bin.lisp +++ b/lisp/install-abcl-bin.lisp @@ -11,7 +11,7 @@ (let ((file (merge-pathnames "tmp/abcl-bin.html" (homedir)))) (format *error-output* "Checking version to install....~%") (download (abcl-bin-uri) file) - (loop for a in (plump:get-elements-by-tag-name + (loop for a in (get-elements-by-tag-name (plump:parse file) "a") for x = (string-right-trim "/" (plump:get-attribute a "href")) when (ignore-errors (digit-char-p (aref x 0))) diff --git a/lisp/install-clisp.lisp b/lisp/install-clisp.lisp index 5f1e2ce..62f6f44 100644 --- a/lisp/install-clisp.lisp +++ b/lisp/install-clisp.lisp @@ -11,7 +11,7 @@ (let ((file (merge-pathnames "tmp/clisp.html" (homedir)))) (format *error-output* "Checking version to install....~%") (download (clisp-version-uri) file :interval (* 60 60)) - (loop for link in (plump:get-elements-by-tag-name (plump:parse file) "a") + (loop for link in (get-elements-by-tag-name (plump:parse file) "a") for href = (plump:get-attribute link "href") for len = (1- (length href)) when (and (eql (aref href len) #\/) (not (eql (aref href 0) #\/)) diff --git a/lisp/install-cmu-bin.lisp b/lisp/install-cmu-bin.lisp index 3e33132..1d13a2c 100644 --- a/lisp/install-cmu-bin.lisp +++ b/lisp/install-cmu-bin.lisp @@ -7,7 +7,7 @@ (let ((file (merge-pathnames "tmp/cmu-bin.html" (homedir)))) (format *error-output* "Checking version to install...~%") (download (format nil "~Arelease/" (cmu-bin-uri)) file :interval (* 60 60)) - (loop for link in (plump:get-elements-by-tag-name (plump:parse file) "a") + (loop for link in (get-elements-by-tag-name (plump:parse file) "a") for href = (plump:get-attribute link "href") for len = (length href) when (and (digit-char-p (aref href 0)) diff --git a/lisp/util-install-quicklisp.lisp b/lisp/util-install-quicklisp.lisp index 9656832..9750367 100644 --- a/lisp/util-install-quicklisp.lisp +++ b/lisp/util-install-quicklisp.lisp @@ -5,6 +5,18 @@ (defvar *build-hook* nil) +(defun get-elements-by-tag-name (node tag) + (let* ((current-version + (ignore-errors + (let* ((* "plump") + (* (ql-dist:find-system *)) + (* (ql-dist:dist *)) + (* (ql-dist:version *))) + *))) + (new (string< "2022-07-08" current-version))) + (funcall (if new #'nreverse #'identity) + (plump:get-elements-by-tag-name node tag)))) + #+sbcl (defclass count-line-stream (sb-gray:fundamental-character-output-stream) ((base :initarg :base diff --git a/lisp/util-install.lisp b/lisp/util-install.lisp index 40e27e2..1a2c2b1 100644 --- a/lisp/util-install.lisp +++ b/lisp/util-install.lisp @@ -5,7 +5,8 @@ :install-system-script :install-impl-if-probed :install-script-if-probed :install-system-if-probed :mingw-namestring :install-github :*checkout-default* :install :decide-version :decide-download :require-system-package - :start :setup :date :github-version :version :install-script :count-line-stream)) + :start :setup :date :github-version :version :install-script :count-line-stream + :get-elements-by-tag-name)) (in-package :roswell.install) (defvar *ros-path* nil) @@ -77,7 +78,7 @@ To differentiate it from the system with the same name in quicklisp, the path sh (download uri file :interval (* 60 60)) (read-call "plump:parse" file)))) (nreverse - (loop for link in (read-call "plump:get-elements-by-tag-name" elts "link") + (loop for link in (read-call "roswell.install:get-elements-by-tag-name" elts "link") for href = (read-call "plump:get-attribute" link "href") when (funcall filter href) collect it))))