quicklisp-abcl: robustify loading

This patch robustifies the process followed by invoking ABCL as:

    abcl --eval "(require :abcl-contrib" --eval "(require :quicklisp-abcl)"

will get ABCL running with an active Quicklisp, downloading components
as necessary.


Try ng to produce and use compiled artifact for
<file:~/quicklisp/setup.lisp> if possible between invocations of the
implementation.
parent 963920d7
......@@ -9,27 +9,35 @@
(defsystem :quicklisp-abcl
:description
"Load Quicklisp from the network if it isn't already installed. <urn:abcl.org/release/1.3.0/contrib/quicklisp-abcl#0.2.0>"
:version "0.2.0"
"Load Quicklisp from the network if it isn't already installed. <urn:abcl.org/release/1.3.0/contrib/quicklisp-abcl#0.3.0>"
:version "0.3.0"
:components nil)
;; #+nil::needs-abcl-asdf((:iri "http://beta.quicklisp.org/quicklisp.lisp"))
;; #+nil::in-order-to ((asdf:compile-op (ql::install))) ;;; FIXME tickle the internal Quicklisp setup
(defmethod perform ((o load-op) (c (eql (find-system 'quicklisp-abcl))))
;;; Load local Quicklisp if it has been an installed
(let ((quicklisp-init (merge-pathnames "quicklisp/setup.lisp"
(user-homedir-pathname))))
(if (probe-file quicklisp-init)
(load quicklisp-init)
(handler-case
(load "https://beta.quicklisp.org/quicklisp.lisp")
(error (e)
(warn "Using insecure transport for remote installation
of Quicklisp:~&~A~&." e)
(load "http://beta.quicklisp.org/quicklisp.lisp"))))
(unless (find-package :quicklisp)
(funcall (intern "INSTALL" "QUICKLISP-QUICKSTART")))))
(let* ((setup (merge-pathnames "quicklisp/setup.abcl"
(user-homedir-pathname)))
(setup-source (merge-pathnames (make-pathname :type "lisp") setup)))
(let ((it (or (probe-file setup)
(probe-file setup-source))))
(if it
;;; First try loaded Quicklisp artifacts if it has been an installed for this user
(prog1
(load it)
;; compilation only succeeds after QUICKLISP has been loaded fully
(unless (probe-file setup)
(compile-file setup-source)))
(progn
(handler-case
(load "https://beta.quicklisp.org/quicklisp.lisp")
(error (e)
(warn "Using insecure transport for remote installation of Quicklisp:~&~A~&." e)
(load "http://beta.quicklisp.org/quicklisp.lisp")))
(unless (find-package :quicklisp)
(funcall (intern "INSTALL" "QUICKLISP-QUICKSTART"))))))))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment