Changeset 14909


Ignore:
Timestamp:
11/17/16 10:42:19 (7 years ago)
Author:
Mark Evenson
Message:

Rework logic behind QUICKLISP-ABCL definition

Simplify load/compile logic. Don't depend an ABCL-ASDF, as it isn't
necessary.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/abcl/contrib/quicklisp/quicklisp-abcl.asd

    r14900 r14909  
    11;;;; -*- Mode: LISP -*-
    22(require :asdf)
    3 (require :abcl-contrib)
    4 (require :abcl-asdf)
    53(in-package :asdf)
    6 
    7 ;; Quicklisp defines:
    8 ;;(defvar *setup-url* "http://beta.quicklisp.org/quickstart/setup.lisp")
    94
    105(defsystem :quicklisp-abcl
    116    :description
    127    "Load Quicklisp from the network if it isn't already installed. <urn:abcl.org/release/1.5.0/contrib/quicklisp-abcl#0.3.0>"
    13     :version "0.3.0"
     8    :version "0.4.0"
    149    :components nil)
    1510
    16 ;; #+nil::needs-abcl-asdf((:iri "http://beta.quicklisp.org/quicklisp.lisp"))
    17 
    1811(defmethod perform ((o load-op) (c (eql (find-system 'quicklisp-abcl))))
    19   (let* ((setup (merge-pathnames "quicklisp/setup.abcl"
    20                                  (user-homedir-pathname)))
    21          (setup-source (merge-pathnames (make-pathname :type "lisp") setup)))
    22     (let ((it (or (probe-file setup)
    23                   (probe-file setup-source))))
    24       (if it
    25            ;;; First try loaded Quicklisp artifacts if it has been an installed for this user
    26           (prog1
    27               (load it)
    28             ;; compilation only succeeds after QUICKLISP has been loaded fully
    29             (unless (probe-file setup)
    30               (compile-file setup-source)))
     12  (let* ((setup-base (merge-pathnames "quicklisp/setup"
     13                                      (user-homedir-pathname)))
     14         (setup-source (probe-file (make-pathname :defaults setup-base
     15                                                  :type "lisp")))
     16         (setup-fasl (probe-file (make-pathname :defaults setup-base
     17                                                  :type "abcl"))))
     18      (if setup-source
     19           ;;; First try loaded Quicklisp compiled fasl if it exists
     20          (if setup-fasl
     21                (handler-case
     22                    (load setup-fasl)
     23                  ;; Sometimes the fasl is invalid; if so, load source, and recompile
     24                  (error (e)
     25                    (when setup-source
     26                      (load setup-source)
     27                      (compile-file setup-source))))
     28                ;; compilation only succeeds after QUICKLISP has been loaded fully
     29                (when setup-source
     30                  (load setup-source)
     31                  (compile-file setup-source)))
     32          ;;; Otherwise execute the quicklisp startup sequence
    3133          (progn
    3234            (handler-case
     
    3436              (error (e)
    3537                (warn "Using insecure transport for remote installation of Quicklisp:~&~A~&." e)
    36                 (load "http://beta.quicklisp.org/quicklisp.lisp")))
    37             (unless (find-package :quicklisp)
    38               (funcall (intern "INSTALL" "QUICKLISP-QUICKSTART"))))))))
     38                (load "http://beta.quicklisp.org/quicklisp.lisp")))))
     39      (unless (find-package :quicklisp)
     40        (funcall (intern "INSTALL" "QUICKLISP-QUICKSTART")))))
     41
    3942
    4043
Note: See TracChangeset for help on using the changeset viewer.