Rework logic behind QUICKLISP-ABCL definition

Simplify load/compile logic.  Don't depend an ABCL-ASDF, as it isn't
necessary.
parent 9c3d5d42
;;;; -*- Mode: LISP -*-
(require :asdf)
(require :abcl-contrib)
(require :abcl-asdf)
(in-package :asdf)
;; Quicklisp defines:
;;(defvar *setup-url* "http://beta.quicklisp.org/quickstart/setup.lisp")
(defsystem :quicklisp-abcl
:description
"Load Quicklisp from the network if it isn't already installed. <urn:abcl.org/release/1.5.0/contrib/quicklisp-abcl#0.3.0>"
:version "0.3.0"
:version "0.4.0"
:components nil)
;; #+nil::needs-abcl-asdf((:iri "http://beta.quicklisp.org/quicklisp.lisp"))
(defmethod perform ((o load-op) (c (eql (find-system 'quicklisp-abcl))))
(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)))
(let* ((setup-base (merge-pathnames "quicklisp/setup"
(user-homedir-pathname)))
(setup-source (probe-file (make-pathname :defaults setup-base
:type "lisp")))
(setup-fasl (probe-file (make-pathname :defaults setup-base
:type "abcl"))))
(if setup-source
;;; First try loaded Quicklisp compiled fasl if it exists
(if setup-fasl
(handler-case
(load setup-fasl)
;; Sometimes the fasl is invalid; if so, load source, and recompile
(error (e)
(when setup-source
(load setup-source)
(compile-file setup-source))))
;; compilation only succeeds after QUICKLISP has been loaded fully
(when setup-source
(load setup-source)
(compile-file setup-source)))
;;; Otherwise execute the quicklisp startup sequence
(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"))))))))
(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