Changeset 14297


Ignore:
Timestamp:
12/06/12 09:26:37 (8 years ago)
Author:
Mark Evenson
Message:

Backport r14296.

Constrain the logic for when CL:REQUIRE pushes symbols to CL:*MODULES*.

A REQUIRE of ABCL-CONTRIB for an instance of the implementation that
cannot locate the contrib binary artifact as being in the same
directory as the location of the ABCL system jar by
SYS:FIND-SYSTEM-JAR now raises an error.

Fixes #275.

Location:
branches/1.1.x/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/1.1.x/src/org/armedbear/lisp/abcl-contrib.lisp

    r14232 r14297  
    33(require :asdf)
    44
    5 ;;; TODO possibly allow customization in system.lisp?
    65(defun find-system-jar ()
     6  "Return the pathname of the system jar, one of `abcl.jar` or `abcl-m.n.p.jar` or `abcl-m.n.p-something.jar`."
    77  (flet ((match-system-jar (p)
    8            "Match `abcl.jar` or `abcl-1.0.1.jar` or `abcl-1.0.1-something.jar`"
    98           (and (pathnamep p)
    109                (equal (pathname-type p) "jar")
     
    2827
    2928(defun find-contrib (&key (verbose nil))
    30 "Attempt to find the ABCL contrib jar and add its contents to ASDF."
     29  "Attempt to find the ABCL contrib jar and add its contents to ASDF.
     30Returns the pathname of the contrib if it can be found."
    3131  (unless *abcl-contrib*
    3232    (unless *abcl-jar*
     
    5151                    (format verbose "~&Added ~A to ASDF.~&" asdf-directory))))
    5252              *abcl-contrib*)
    53         (format verbose "Failed to find abcl-contrib at '~A'." abcl-contrib))))))
     53            (error "Failed to find abcl-contrib at '~A'." abcl-contrib))))))
    5454
    5555(when (find-contrib :verbose t)
  • branches/1.1.x/src/org/armedbear/lisp/require.lisp

    r14170 r14297  
    5757  (unless (member (string module-name) *modules* :test #'string=)
    5858    (let ((saved-modules (copy-list *modules*)))
    59       (cond (pathnames
    60              (unless (listp pathnames) (setf pathnames (list pathnames)))
    61              (dolist (x pathnames)
    62                (load x))
    63              (provide module-name))
    64             (t
    65              (if (some (lambda (p) (funcall p module-name))
     59      (cond               
     60;;; Since these are files packaged with the system we ensure that
     61;;; PROVIDE has been called unless the module has other dependencies
     62;;; that must be satisfied to be loaded, which is currently only the
     63;;; case with 'abcl-contrib'.
     64        (pathnames
     65         (unless (listp pathnames) (setf pathnames (list pathnames)))
     66         (dolist (x pathnames)
     67           (load x))
     68         (unless (string-equal module-name "abcl-contrib")
     69           (provide module-name)))
     70;;; Responsibility for actually calling PROVIDE up to module provider
     71;;; function
     72        (t
     73         (unless (some (lambda (p) (funcall p module-name))
    6674                           (append (list #'module-provide-system)
    67                                  sys::*module-provider-functions*))
    68                  (provide module-name) ;; Shouldn't hurt
    69                  (error "Don't know how to ~S ~A." 'require module-name))))
     75                                   sys::*module-provider-functions*))
     76               (error "Don't know how to ~S ~A." 'require module-name))))
    7077      (set-difference *modules* saved-modules))))
    7178
Note: See TracChangeset for help on using the changeset viewer.