diff --git a/lisp/asdf.ros b/lisp/asdf.ros index 8345caa..5697b98 100644 --- a/lisp/asdf.ros +++ b/lisp/asdf.ros @@ -13,7 +13,7 @@ exec ros -Q -m roswell -L sbcl-bin -- $0 "$@" (if (find-package :ros.sub.asdf) (push :ros.sub.asdf *features*) (defpackage :ros.sub.asdf - (:use :cl :ros.util))) + (:use :cl :ros.util :ros.locations))) (in-package :ros.sub.asdf) (ros:quicklisp :environment nil) @@ -23,7 +23,7 @@ exec ros -Q -m roswell -L sbcl-bin -- $0 "$@" (defun asdf-get-version () (format *error-output* "Checking version to install....~%") (ros.install::github-version - "fare" "asdf" (lambda (href) (subseq href (1+ (position #\/ href :from-end t)))))) + *asdf-git-version-uri* "asdf" (lambda (href) (subseq href (1+ (position #\/ href :from-end t)))))) (defvar *subcommands* '(("install" . asdf-install) diff --git a/lisp/install-ecl.lisp b/lisp/install-ecl.lisp index 7f2eef0..947fe85 100644 --- a/lisp/install-ecl.lisp +++ b/lisp/install-ecl.lisp @@ -6,14 +6,14 @@ (defun ecl-get-version () (format *error-output* "Checking version to install....~%") - (github-version "roswell" "mirror-ecl" + (github-version *ecl-git-version-uri* "ecl" (lambda (href) (let ((a (subseq href (1+ (position #\/ href :from-end t))))) (subseq a (position-if #'digit-char-p a)))))) (defun ecl-version-filename (version) (find-if (lambda (x) (ignore-errors (equal (subseq x (- (length x) (length version))) version))) - (github-version "roswell" "mirror-ecl" + (github-version *ecl-git-version-uri* "ecl" (lambda (href) (subseq href (1+ (position #\/ href :from-end t))))))) (defun ecl-msys (argv) diff --git a/lisp/install-sbcl.lisp b/lisp/install-sbcl.lisp index 123d0f3..5541c35 100644 --- a/lisp/install-sbcl.lisp +++ b/lisp/install-sbcl.lisp @@ -34,7 +34,7 @@ (defun sbcl-get-version () (format *error-output* "Checking version to install....~%") - (github-version "sbcl" "sbcl" (lambda (href) (subseq href (1+ (position #\- href :from-end t)))))) + (github-version *sbcl-git-version-uri* "sbcl" (lambda (href) (subseq href (1+ (position #\- href :from-end t)))))) (defun sbcl-msys (argv) (unless (or (ros:getenv "MSYSCON") diff --git a/lisp/locations.lisp b/lisp/locations.lisp index 7f4564a..e807f9d 100644 --- a/lisp/locations.lisp +++ b/lisp/locations.lisp @@ -24,3 +24,7 @@ (defuri :sbcl-patch1 "https://gist.githubusercontent.com/snmsts/e8e4fd4bd5e458ac45e8/raw/bb7f1cd2e8e9a914f4e9b1b5acf889ecf75dfe0c/posix-tests.patch") (defuri :clisp-patch1 "https://raw.githubusercontent.com/Homebrew/homebrew/2fb8cb1a2279f80dc89900b3ebaca9e5afc90494/Library/Formula/clisp.rb") + +(defuri :ecl-git-version "https://github.com/roswell/mirror-ecl/releases.atom") +(defuri :sbcl-git-version "https://github.com/sbcl/sbcl/releases.atom") +(defuri :asdf-git-version "https://github.com/fare/asdf/releases.atom") diff --git a/lisp/util-install-quicklisp.lisp b/lisp/util-install-quicklisp.lisp index 61de129..4d00633 100644 --- a/lisp/util-install-quicklisp.lisp +++ b/lisp/util-install-quicklisp.lisp @@ -177,17 +177,6 @@ :second 0)) ;;(parse-date "22-Aug-2015 18:19 ") -(defun github-version (user project filter) - (let ((file (merge-pathnames (format nil "tmp/~A.html" project) (homedir)))) - (unless (and (probe-file file) - (< (get-universal-time) (+ (* 60 60) (file-write-date file)))) - (download (format nil "https://github.com/~A/~A/releases.atom" user project) file)) - (nreverse - (loop for link in (plump:get-elements-by-tag-name (plump:parse file) "link") - for href = (plump:get-attribute link "href") - when (eql (aref href 0) #\/) - collect (funcall filter href))))) - (asdf:defsystem :roswell.install.abcl-bin :components ((:file "install-abcl-bin"))) (asdf:defsystem :roswell.install.ccl-bin :components ((:file "install-ccl-bin"))) (asdf:defsystem :roswell.install.clisp :components ((:file "install-clisp"))) diff --git a/lisp/util-install.lisp b/lisp/util-install.lisp index 43122ba..ad5068d 100644 --- a/lisp/util-install.lisp +++ b/lisp/util-install.lisp @@ -50,3 +50,14 @@ (declare (ignore condition)) (format t "SIGINT detected, cleaning up the partially installed files~%") (ros:roswell `(,(format nil "deleteing ~A/~A" (getf (cdr param) :target) (getf (cdr param) :version))) :string t))))))) + +(defun github-version (uri project filter) + (let ((file (merge-pathnames (format nil "tmp/~A.html" project) (homedir)))) + (unless (and (probe-file file) + (< (get-universal-time) (+ (* 60 60) (file-write-date file)))) + (download uri file)) + (nreverse + (loop for link in (read-call "plump:get-elements-by-tag-name" (read-call "plump:parse" file) "link") + for href = (read-call "plump:get-attribute" link "href") + when (eql (aref href 0) #\/) + collect (funcall filter href)))))