Changeset 14706
- Timestamp:
- Apr 8, 2011, 11:38:24 AM (14 years ago)
- File:
-
- 1 edited
-
trunk/source/tools/asdf.lisp (modified) (125 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/source/tools/asdf.lisp
r14688 r14706 1 ;;; -*- mode: common-lisp; package: asdf;-*-2 ;;; This is ASDF : Another System Definition Facility.1 ;;; -*- mode: common-lisp; Base: 10 ; Syntax: ANSI-Common-Lisp -*- 2 ;;; This is ASDF 2.014: Another System Definition Facility. 3 3 ;;; 4 4 ;;; Feedback, bug reports, and patches are all welcome: … … 11 11 ;;; location above for a more recent version (and for documentation 12 12 ;;; and test files, if your copy came without them) before reporting 13 ;;; bugs. There are usually two "supported" revisions - the git HEAD14 ;;; is the latest development version, whereas the revision tagged15 ;;; RELEASEmay be slightly older but is considered `stable'13 ;;; bugs. There are usually two "supported" revisions - the git master 14 ;;; branch is the latest development version, whereas the git release 15 ;;; branch may be slightly older but is considered `stable' 16 16 17 17 ;;; -- LICENSE START … … 48 48 #+xcvb (module ()) 49 49 50 (cl:in-package :cl-user)50 (cl:in-package #-genera :common-lisp-user #+genera :future-common-lisp-user) 51 51 52 52 #+gcl (defpackage :asdf (:use :cl)) ;; GCL treats defpackage magically and needs this … … 56 56 ;;; DEFPACKAGE may cause errors on discrepancies, so we avoid it. 57 57 (unless (find-package :asdf) 58 (make-package :asdf :use '(:c l)))58 (make-package :asdf :use '(:common-lisp))) 59 59 ;;; Implementation-dependent tweaks 60 60 ;; (declaim (optimize (speed 2) (debug 2) (safety 3))) ; NO: rely on the implementation defaults. … … 63 63 (remove "asdf" excl::*autoload-package-name-alist* 64 64 :test 'equalp :key 'car)) 65 #+ecl (require :cmp)) 65 #+(and ecl (not ecl-bytecmp)) (require :cmp) 66 #+(and (or win32 windows mswindows mingw32) (not cygwin)) (pushnew :asdf-windows *features*) 67 #+(or unix cygwin) (pushnew :asdf-unix *features*)) 66 68 67 69 (in-package :asdf) 70 71 ;;; Strip out formating that is not supported on Genera. 72 (defmacro compatfmt (format) 73 #-genera format 74 #+genera 75 (let ((r '(("~@<" . "") 76 ("; ~@;" . "; ") 77 ("~3i~_" . "") 78 ("~@:>" . "") 79 ("~:>" . "")))) 80 (dolist (i r) 81 (loop :for found = (search (car i) format) :while found :do 82 (setf format (concatenate 'simple-string (subseq format 0 found) 83 (cdr i) 84 (subseq format (+ found (length (car i)))))))) 85 format)) 68 86 69 87 ;;;; Create packages in a way that is compatible with hot-upgrade. … … 77 95 ;; Please also modify asdf.asd to reflect this change. The script bin/bump-version 78 96 ;; can help you do these changes in synch (look at the source for documentation). 97 ;; Relying on its automation, the version is now redundantly present on top of this file. 79 98 ;; "2.345" would be an official release 80 99 ;; "2.345.6" would be a development version in the official upstream 81 100 ;; "2.345.0.7" would be your seventh local modification of official release 2.345 82 101 ;; "2.345.6.7" would be your seventh local modification of development version 2.345.6 83 (asdf-version "2.01 2")102 (asdf-version "2.014") 84 103 (existing-asdf (fboundp 'find-system)) 85 104 (existing-version *asdf-version*) … … 88 107 (when existing-asdf 89 108 (format *trace-output* 90 "~&~@<; ~@;Upgrading ASDF package ~@[from version ~A ~]to version ~A~@:>~%" 91 existing-version asdf-version))109 (compatfmt "~&~@<; ~@;Upgrading ASDF ~@[from version ~A ~]to version ~A~@:>~%") 110 existing-version asdf-version)) 92 111 (labels 93 ((unlink-package (package) 112 ((present-symbol-p (symbol package) 113 (member (nth-value 1 (find-sym symbol package)) '(:internal :external))) 114 (present-symbols (package) 115 ;; #-genera (loop :for s :being :the :present-symbols :in package :collect s) #+genera 116 (let (l) 117 (do-symbols (s package) 118 (when (present-symbol-p s package) (push s l))) 119 (reverse l))) 120 (unlink-package (package) 94 121 (let ((u (find-package package))) 95 122 (when u 96 (ensure-unintern u 97 (loop :for s :being :each :present-symbol :in u :collect s)) 123 (ensure-unintern u (present-symbols u)) 98 124 (loop :for p :in (package-used-by-list u) :do 99 125 (unuse-package u p)) … … 149 175 (bothly-exported-symbols nil) 150 176 (newly-exported-symbols nil)) 151 ( loop :for sym :being :each :external-symbol :in package :do177 (do-external-symbols (sym package) 152 178 (if (member sym export :test 'string-equal) 153 179 (push sym bothly-exported-symbols) … … 187 213 #:perform-with-restarts #:component-relative-pathname 188 214 #:system-source-file #:operate #:find-component #:find-system 189 #:apply-output-translations #:translate-pathname* #:resolve-location) 215 #:apply-output-translations #:translate-pathname* #:resolve-location 216 #:compile-file*) 190 217 :unintern 191 218 (#:*asdf-revision* #:around #:asdf-method-combination … … 279 306 280 307 #:clear-configuration 308 #:*output-translations-parameter* 281 309 #:initialize-output-translations 282 310 #:disable-output-translations … … 288 316 #:enable-asdf-binary-locations-compatibility 289 317 #:*default-source-registries* 318 #:*source-registry-parameter* 290 319 #:initialize-source-registry 291 320 #:compute-source-registry … … 309 338 ;; #:find-symbol* 310 339 #:merge-pathnames* 340 #:coerce-pathname 311 341 #:pathname-directory-pathname 312 342 #:read-file-forms … … 320 350 #:truenamize 321 351 #:while-collecting))) 352 #+genera (import 'scl:boolean :asdf) 322 353 (setf *asdf-version* asdf-version 323 354 *upgraded-p* (if existing-version … … 331 362 "Exported interface to the version of ASDF currently installed. A string. 332 363 You can compare this string with e.g.: 333 (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSION) \"2.0 00\")."364 (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSION) \"2.013\")." 334 365 *asdf-version*) 335 366 … … 406 437 (make-pathname :name nil :type nil :version nil :defaults pathname))) 407 438 439 (defun* normalize-pathname-directory-component (directory) 440 (cond 441 #-(or cmu sbcl scl) 442 ((stringp directory) `(:absolute ,directory) directory) 443 #+gcl 444 ((and (consp directory) (stringp (first directory))) 445 `(:absolute ,@directory)) 446 ((or (null directory) 447 (and (consp directory) (member (first directory) '(:absolute :relative)))) 448 directory) 449 (t 450 (error (compatfmt "~@<Unrecognized pathname directory component ~S~@:>") directory)))) 451 452 (defun* merge-pathname-directory-components (specified defaults) 453 (let ((directory (normalize-pathname-directory-component specified))) 454 (ecase (first directory) 455 ((nil) defaults) 456 (:absolute specified) 457 (:relative 458 (let ((defdir (normalize-pathname-directory-component defaults)) 459 (reldir (cdr directory))) 460 (cond 461 ((null defdir) 462 directory) 463 ((not (eq :back (first reldir))) 464 (append defdir reldir)) 465 (t 466 (loop :with defabs = (first defdir) 467 :with defrev = (reverse (rest defdir)) 468 :while (and (eq :back (car reldir)) 469 (or (and (eq :absolute defabs) (null defrev)) 470 (stringp (car defrev)))) 471 :do (pop reldir) (pop defrev) 472 :finally (return (cons defabs (append (reverse defrev) reldir))))))))))) 473 408 474 (defun* merge-pathnames* (specified &optional (defaults *default-pathname-defaults*)) 409 475 "MERGE-PATHNAMES* is like MERGE-PATHNAMES except that if the SPECIFIED pathname … … 412 478 (when (null specified) (return-from merge-pathnames* defaults)) 413 479 (when (null defaults) (return-from merge-pathnames* specified)) 480 #+scl 481 (ext:resolve-pathname specified defaults) 482 #-scl 414 483 (let* ((specified (pathname specified)) 415 484 (defaults (pathname defaults)) 416 (directory (pathname-directory specified)) 417 (directory 418 (cond 419 #-(or sbcl cmu scl) 420 ((stringp directory) `(:absolute ,directory) directory) 421 #+gcl 422 ((and (consp directory) (not (member (first directory) '(:absolute :relative)))) 423 `(:relative ,@directory)) 424 ((or (null directory) 425 (and (consp directory) (member (first directory) '(:absolute :relative)))) 426 directory) 427 (t 428 (error "Unrecognized directory component ~S in pathname ~S" directory specified)))) 485 (directory (normalize-pathname-directory-component (pathname-directory specified))) 429 486 (name (or (pathname-name specified) (pathname-name defaults))) 430 487 (type (or (pathname-type specified) (pathname-type defaults))) … … 436 493 (multiple-value-bind (host device directory unspecific-handler) 437 494 (ecase (first directory) 438 ((nil)439 (values (pathname-host defaults)440 (pathname-device defaults)441 (pathname-directory defaults)442 (unspecific-handler defaults)))443 495 ((:absolute) 444 496 (values (pathname-host specified) … … 446 498 directory 447 499 (unspecific-handler specified))) 448 (( :relative)500 ((nil :relative) 449 501 (values (pathname-host defaults) 450 502 (pathname-device defaults) 451 (if (pathname-directory defaults) 452 (append (pathname-directory defaults) (cdr directory)) 453 directory) 503 (merge-pathname-directory-components directory (pathname-directory defaults)) 454 504 (unspecific-handler defaults)))) 455 505 (make-pathname :host host :device device :directory directory … … 458 508 :version (funcall unspecific-handler version)))))) 459 509 510 (defun* pathname-parent-directory-pathname (pathname) 511 "Returns a new pathname with same HOST, DEVICE, DIRECTORY as PATHNAME, 512 and NIL NAME, TYPE and VERSION components" 513 (when pathname 514 (make-pathname :name nil :type nil :version nil 515 :directory (merge-pathname-directory-components '(:relative :back) (pathname-directory pathname)) 516 :defaults pathname))) 517 518 460 519 (define-modify-macro appendf (&rest args) 461 520 append "Append onto list") ;; only to be used on short lists. … … 470 529 (and (stringp s) (plusp (length s)) (char s (1- (length s))))) 471 530 531 472 532 (defun* asdf-message (format-string &rest format-args) 473 533 (declare (dynamic-extent format-args)) … … 499 559 ;; See CLHS make-pathname and 19.2.2.2.3. 500 560 ;; We only use it on implementations that support it. 501 (or #+(or c clgcl lispworks sbcl) :unspecific)))561 (or #+(or clozure gcl lispworks sbcl) :unspecific))) 502 562 (destructuring-bind (name &optional (type unspecific)) 503 563 (split-string filename :max 2 :separator ".") … … 524 584 (check-type s string) 525 585 (when (find #\: s) 526 (error "a portable ASDF pathname designator cannot include a #\: character: ~S"s))586 (error (compatfmt "~@<A portable ASDF pathname designator cannot include a #\: character: ~3i~_~S~@:>") s)) 527 587 (let* ((components (split-string s :separator "/")) 528 588 (last-comp (car (last components)))) … … 532 592 (progn 533 593 (when force-relative 534 (error "absolute pathname designator not allowed: ~S"s))594 (error (compatfmt "~@<Absolute pathname designator not allowed: ~3i~_~S~@:>") s)) 535 595 (values :absolute (cdr components))) 536 596 (values :relative nil)) 537 597 (values :relative components)) 538 (setf components (remove "" components :test #'equal)) 598 (setf components (remove-if #'(lambda (x) (member x '("" ".") :test #'equal)) components)) 599 (setf components (substitute :back ".." components :test #'equal)) 539 600 (cond 540 601 ((equal last-comp "") … … 556 617 :append (list k v))) 557 618 619 #+mcl 620 (eval-when (:compile-toplevel :load-toplevel :execute) 621 (ccl:define-entry-point (_getenv "getenv") ((name :string)) :string)) 622 558 623 (defun* getenv (x) 559 (#+(or abcl clisp) ext:getenv 560 #+allegro sys:getenv 561 #+clozure ccl:getenv 562 #+(or cmu scl) (lambda (x) (cdr (assoc x ext:*environment-list* :test #'string=))) 563 #+ecl si:getenv 564 #+gcl system:getenv 565 #+lispworks lispworks:environment-variable 566 #+sbcl sb-ext:posix-getenv 567 x)) 624 (declare (ignorable x)) 625 #+(or abcl clisp) (ext:getenv x) 626 #+allegro (sys:getenv x) 627 #+clozure (ccl:getenv x) 628 #+(or cmu scl) (cdr (assoc x ext:*environment-list* :test #'string=)) 629 #+ecl (si:getenv x) 630 #+gcl (system:getenv x) 631 #+genera nil 632 #+lispworks (lispworks:environment-variable x) 633 #+mcl (ccl:with-cstrs ((name x)) 634 (let ((value (_getenv name))) 635 (unless (ccl:%null-ptr-p value) 636 (ccl:%get-cstring value)))) 637 #+sbcl (sb-ext:posix-getenv x) 638 #-(or abcl allegro clisp clozure cmu ecl gcl genera lispworks mcl sbcl scl) 639 (error "getenv not available on your implementation")) 568 640 569 641 (defun* directory-pathname-p (pathname) … … 591 663 (ensure-directory-pathname (pathname pathspec))) 592 664 ((not (pathnamep pathspec)) 593 (error "Invalid pathname designator ~S"pathspec))665 (error (compatfmt "~@<Invalid pathname designator ~S~@:>") pathspec)) 594 666 ((wild-pathname-p pathspec) 595 (error "Can't reliably convert wild pathname ~S"pathspec))667 (error (compatfmt "~@<Can't reliably convert wild pathname ~3i~_~S~@:>") pathspec)) 596 668 ((directory-pathname-p pathspec) 597 669 pathspec) … … 603 675 :defaults pathspec)))) 604 676 677 #+genera 678 (unless (fboundp 'ensure-directories-exist) 679 (defun ensure-directories-exist (path) 680 (fs:create-directories-recursively (pathname path)))) 681 605 682 (defun* absolute-pathname-p (pathspec) 606 683 (and (typep pathspec '(or pathname string)) … … 630 707 :collect form))) 631 708 632 # -(and (or win32 windows mswindows mingw32) (not cygwin))709 #+asdf-unix 633 710 (progn 634 711 #+ecl #.(cl:and (cl:< ext:+ecl-version-number+ 100601) … … 654 731 655 732 (defun* pathname-root (pathname) 656 (make-pathname : host (pathname-host pathname)657 : device (pathname-device pathname)658 :d irectory '(:absolute)659 :name nil :type nil :version nil))733 (make-pathname :directory '(:absolute) 734 :name nil :type nil :version nil 735 :defaults pathname ;; host device, and on scl scheme scheme-specific-part port username password 736 . #.(or #+scl '(:parameters nil :query nil :fragment nil)))) 660 737 661 738 (defun* find-symbol* (s p) … … 670 747 (pathname (unless (wild-pathname-p p) 671 748 #.(or #+(or allegro clozure cmu ecl sbcl scl) '(probe-file p) 672 #+clisp (aif (find-symbol (string '#:probe-pathname) :ext) `(ignore-errors (,it p)))673 '(ignore-errors (truename p)))))))749 #+clisp (aif (find-symbol (string '#:probe-pathname) :ext) `(ignore-errors (,it p))) 750 '(ignore-errors (truename p))))))) 674 751 675 752 (defun* truenamize (p) 676 753 "Resolve as much of a pathname as possible" 677 754 (block nil 678 (when (typep p ' logical-pathname) (return p))755 (when (typep p '(or null logical-pathname)) (return p)) 679 756 (let* ((p (merge-pathnames* p)) 680 757 (directory (pathname-directory p))) … … 682 759 (let ((found (probe-file* p))) 683 760 (when found (return found))) 684 #-(or sbcl cmu) (when (stringp directory) (return p))761 #-(or cmu sbcl scl) (when (stringp directory) (return p)) 685 762 (when (not (eq :absolute (car directory))) (return p)) 686 763 (let ((sofar (probe-file* (pathname-root p)))) … … 708 785 (defun* resolve-symlinks (path) 709 786 #-allegro (truenamize path) 710 #+allegro (excl:pathname-resolve-symbolic-links path)) 787 #+allegro (if (typep path 'logical-pathname) 788 path 789 (excl:pathname-resolve-symbolic-links path))) 711 790 712 791 (defun* default-directory () … … 728 807 (merge-pathnames* *wild-path* path)) 729 808 809 #-scl 810 (defun directory-separator-for-host (&optional (pathname *default-pathname-defaults*)) 811 (let ((foo (make-pathname :directory '(:absolute "FOO") :defaults pathname))) 812 (last-char (namestring foo)))) 813 814 #-scl 730 815 (defun* directorize-pathname-host-device (pathname) 731 816 (let* ((root (pathname-root pathname)) 732 817 (wild-root (wilden root)) 733 818 (absolute-pathname (merge-pathnames* pathname root)) 734 (foo (make-pathname :directory '(:absolute "FOO") :defaults root)) 735 (separator (last-char (namestring foo))) 819 (separator (directory-separator-for-host root)) 736 820 (root-namestring (namestring root)) 737 821 (root-string 738 822 (substitute-if #\/ 739 (lambda (x) (or (eql x #\:)740 (eql x separator)))823 #'(lambda (x) (or (eql x #\:) 824 (eql x separator))) 741 825 root-namestring))) 742 826 (multiple-value-bind (relative path filename) … … 747 831 :directory `(:absolute ,@path)))) 748 832 (translate-pathname absolute-pathname wild-root (wilden new-base)))))) 833 834 #+scl 835 (defun* directorize-pathname-host-device (pathname) 836 (let ((scheme (ext:pathname-scheme pathname)) 837 (host (pathname-host pathname)) 838 (port (ext:pathname-port pathname)) 839 (directory (pathname-directory pathname))) 840 (flet ((not-unspecific (component) 841 (and (not (eq component :unspecific)) component))) 842 (cond ((or (not-unspecific port) 843 (and (not-unspecific host) (plusp (length host))) 844 (not-unspecific scheme)) 845 (let ((prefix "")) 846 (when (not-unspecific port) 847 (setf prefix (format nil ":~D" port))) 848 (when (and (not-unspecific host) (plusp (length host))) 849 (setf prefix (concatenate 'string host prefix))) 850 (setf prefix (concatenate 'string ":" prefix)) 851 (when (not-unspecific scheme) 852 (setf prefix (concatenate 'string scheme prefix))) 853 (assert (and directory (eq (first directory) :absolute))) 854 (make-pathname :directory `(:absolute ,prefix ,@(rest directory)) 855 :defaults pathname))) 856 (t 857 pathname))))) 749 858 750 859 ;;;; ------------------------------------------------------------------------- … … 857 966 ;;; Methods in case of hot-upgrade. See https://bugs.launchpad.net/asdf/+bug/485687 858 967 (when *upgraded-p* 859 #+ecl860 (when (find-class 'compile-op nil)861 (defmethod update-instance-for-redefined-class :after862 ((c compile-op) added deleted plist &key)863 (declare (ignore added deleted))864 (let ((system-p (getf plist 'system-p)))865 (when system-p (setf (getf (slot-value c 'flags) :system-p) system-p)))))866 968 (when (find-class 'module nil) 867 969 (eval … … 870 972 (declare (ignorable deleted plist)) 871 973 (when (or *asdf-verbose* *load-verbose*) 872 (asdf-message "~&~@<; ~@; Updating ~A for ASDF ~A~@:>~%" m ,(asdf-version))) 974 (asdf-message (compatfmt "~&~@<; ~@;Updating ~A for ASDF ~A~@:>~%") 975 m ,(asdf-version))) 873 976 (when (member 'components-by-name added) 874 977 (compute-module-components-by-name m)) … … 898 1001 error-component error-operation 899 1002 module-components module-components-by-name 900 circular-dependency-components) 1003 circular-dependency-components 1004 condition-arguments condition-form 1005 condition-format condition-location 1006 coerce-name) 901 1007 (ftype (function (t t) t) (setf module-components-by-name))) 902 1008 … … 906 1012 (format-arguments :initarg :format-arguments :reader format-arguments)) 907 1013 (:report (lambda (c s) 908 (apply #'format s (format-control c) (format-arguments c)))))1014 (apply #'format s (format-control c) (format-arguments c))))) 909 1015 910 1016 (define-condition load-system-definition-error (system-definition-error) … … 913 1019 (condition :initarg :condition :reader error-condition)) 914 1020 (:report (lambda (c s) 915 (format s "~@<Error while trying to load definition for system ~A from pathname ~A: ~A~@:>" 916 (error-name c) (error-pathname c) (error-condition c)))))1021 (format s (compatfmt "~@<Error while trying to load definition for system ~A from pathname ~A: ~3i~_~A~@:>") 1022 (error-name c) (error-pathname c) (error-condition c))))) 917 1023 918 1024 (define-condition circular-dependency (system-definition-error) 919 1025 ((components :initarg :components :reader circular-dependency-components)) 920 1026 (:report (lambda (c s) 921 (format s "~@<Circular dependency: ~S~@:>" (circular-dependency-components c))))) 1027 (format s (compatfmt "~@<Circular dependency: ~3i~_~S~@:>") 1028 (circular-dependency-components c))))) 922 1029 923 1030 (define-condition duplicate-names (system-definition-error) 924 1031 ((name :initarg :name :reader duplicate-names-name)) 925 1032 (:report (lambda (c s) 926 (format s "~@<Error while defining system: multiple components are given same name ~A~@:>" 927 (duplicate-names-name c)))))1033 (format s (compatfmt "~@<Error while defining system: multiple components are given same name ~A~@:>") 1034 (duplicate-names-name c))))) 928 1035 929 1036 (define-condition missing-component (system-definition-error) … … 945 1052 (operation :reader error-operation :initarg :operation)) 946 1053 (:report (lambda (c s) 947 (format s "~@<erred while invoking ~A on ~A~@:>"948 (error-operation c) (error-component c)))))1054 (format s (compatfmt "~@<Error while invoking ~A on ~A~@:>") 1055 (error-operation c) (error-component c))))) 949 1056 (define-condition compile-error (operation-error) ()) 950 1057 (define-condition compile-failed (compile-error) ()) … … 957 1064 (arguments :reader condition-arguments :initarg :arguments :initform nil)) 958 1065 (:report (lambda (c s) 959 (format s "~@<~? (will be skipped)~@:>"960 (condition-format c)961 (list* (condition-form c) (condition-location c)962 (condition-arguments c))))))1066 (format s (compatfmt "~@<~? (will be skipped)~@:>") 1067 (condition-format c) 1068 (list* (condition-form c) (condition-location c) 1069 (condition-arguments c)))))) 963 1070 (define-condition invalid-source-registry (invalid-configuration warning) 964 ((format :initform "~@<invalid source registry ~S~@[ in ~S~]~@{ ~@?~}~>")))1071 ((format :initform (compatfmt "~@<Invalid source registry ~S~@[ in ~S~]~@{ ~@?~}~@:>")))) 965 1072 (define-condition invalid-output-translation (invalid-configuration warning) 966 ((format :initform "~@<invalid asdf output-translation ~S~@[ in ~S~]~@{ ~@?~}~>")))1073 ((format :initform (compatfmt "~@<Invalid asdf output-translation ~S~@[ in ~S~]~@{ ~@?~}~@:>")))) 967 1074 968 1075 (defclass component () … … 970 1077 "Component name: designator for a string composed of portable pathname characters") 971 1078 (version :accessor component-version :initarg :version) 972 ;; This one is used by POIU. Maybe in the future by ASDF instead of in-order-to? 973 ;; POIU is a parallel (multi-process build) extension of ASDF. See 974 ;; http://www.cliki.net/poiu 1079 (description :accessor component-description :initarg :description) 1080 (long-description :accessor component-long-description :initarg :long-description) 1081 ;; This one below is used by POIU - http://www.cliki.net/poiu 1082 ;; a parallelizing extension of ASDF that compiles in multiple parallel 1083 ;; slave processes (forked on demand) and loads in the master process. 1084 ;; Maybe in the future ASDF may use it internally instead of in-order-to. 975 1085 (load-dependencies :accessor component-load-dependencies :initform nil) 976 1086 ;; In the ASDF object model, dependencies exist between *actions* … … 991 1101 ;; hasn't yet been loaded in the current image (do-first). 992 1102 ;; The names are crap, but they have been the official API since Dan Barlow's ASDF 1.52! 1103 ;; See our ASDF 2 paper for more complete explanations. 993 1104 (in-order-to :initform nil :initarg :in-order-to 994 1105 :accessor component-in-order-to) … … 1018 1129 (defmethod print-object ((c component) stream) 1019 1130 (print-unreadable-object (c stream :type t :identity nil) 1020 (format stream "~ @<~{~S~^ ~}~@:>" (component-find-path c))))1131 (format stream "~{~S~^ ~}" (component-find-path c)))) 1021 1132 1022 1133 … … 1024 1135 1025 1136 (defmethod print-object ((c missing-dependency) s) 1026 (format s "~@<~A, required by ~A~@:>"1137 (format s (compatfmt "~@<~A, required by ~A~@:>") 1027 1138 (call-next-method c nil) (missing-required-by c))) 1028 1139 … … 1034 1145 1035 1146 (defmethod print-object ((c missing-component) s) 1036 (format s "~@<component ~S not found~@[ in ~A~]~@:>"1147 (format s (compatfmt "~@<Component ~S not found~@[ in ~A~]~@:>") 1037 1148 (missing-requires c) 1038 1149 (when (missing-parent c) … … 1040 1151 1041 1152 (defmethod print-object ((c missing-component-of-version) s) 1042 (format s "~@<component ~S does not match version ~A~@[ in ~A~]~@:>"1153 (format s (compatfmt "~@<Component ~S does not match version ~A~@[ in ~A~]~@:>") 1043 1154 (missing-requires c) 1044 1155 (missing-version c) … … 1100 1211 (pathname-directory-pathname (component-parent-pathname component))))) 1101 1212 (unless (or (null pathname) (absolute-pathname-p pathname)) 1102 (error "Invalid relative pathname ~S for component ~S"1213 (error (compatfmt "~@<Invalid relative pathname ~S for component ~S~@:>") 1103 1214 pathname (component-find-path component))) 1104 1215 (setf (slot-value component 'absolute-pathname) pathname) … … 1117 1228 1118 1229 (defclass system (module) 1119 ((description :accessor system-description :initarg :description) 1120 (long-description 1121 :accessor system-long-description :initarg :long-description) 1230 (;; description and long-description are now available for all component's, 1231 ;; but now also inherited from component, but we add the legacy accessor 1232 (description :accessor system-description :initarg :description) 1233 (long-description :accessor system-long-description :initarg :long-description) 1122 1234 (author :accessor system-author :initarg :author) 1123 1235 (maintainer :accessor system-maintainer :initarg :maintainer) … … 1168 1280 (symbol (string-downcase (symbol-name name))) 1169 1281 (string name) 1170 (t (sysdef-error "~@<invalid component designator ~A~@:>"name))))1282 (t (sysdef-error (compatfmt "~@<Invalid component designator: ~3i~_~A~@:>") name)))) 1171 1283 1172 1284 (defun* system-registered-p (name) … … 1186 1298 FN should be a function of one argument. It will be 1187 1299 called with an object of type asdf:system." 1188 (maphash (lambda (_ datum) 1189 (declare (ignore _)) 1190 (destructuring-bind (_ . def) datum 1300 (maphash #'(lambda (_ datum) 1191 1301 (declare (ignore _)) 1192 (funcall fn def))) 1302 (destructuring-bind (_ . def) datum 1303 (declare (ignore _)) 1304 (funcall fn def))) 1193 1305 *defined-systems*)) 1194 1306 … … 1202 1314 (let ((system-name (coerce-name system))) 1203 1315 (or 1204 (some (lambda (x) (funcall x system-name))1316 (some #'(lambda (x) (funcall x system-name)) 1205 1317 *system-definition-search-functions*) 1206 1318 (let ((system-pair (system-registered-p system-name))) … … 1231 1343 :name name 1232 1344 :type "asd"))) 1233 (when (probe-file file)1345 (when (probe-file* file) 1234 1346 (return file))) 1235 #+(and (or win32 windows mswindows mingw32) (not cygwin)(not clisp))1347 #+(and asdf-windows (not clisp)) 1236 1348 (let ((shortcut 1237 1349 (make-pathname … … 1239 1351 :name (concatenate 'string name ".asd") 1240 1352 :type "lnk"))) 1241 (when (probe-file shortcut)1353 (when (probe-file* shortcut) 1242 1354 (let ((target (parse-windows-shortcut shortcut))) 1243 1355 (when target … … 1262 1374 (message 1263 1375 (format nil 1264 "~@<While searching for system ~S: ~S evaluated to ~S which is not a directory.~@:>"1376 (compatfmt "~@<While searching for system ~S: ~3i~_~S evaluated to ~S which is not a directory.~@:>") 1265 1377 system dir defaults))) 1266 1378 (error message)) … … 1270 1382 (coerce-entry-to-directory () 1271 1383 :report (lambda (s) 1272 (format s "Coerce entry to ~a, replace ~a and continue." 1273 (ensure-directory-pathname defaults) dir))1384 (format s (compatfmt "~@<Coerce entry to ~a, replace ~a and continue.~@:>") 1385 (ensure-directory-pathname defaults) dir)) 1274 1386 (push (cons dir (ensure-directory-pathname defaults)) to-replace)))))))) 1275 1387 ;; cleanup … … 1303 1415 ;; as if the file were very old. 1304 1416 ;; (or should we treat the case in a different, special way?) 1305 (or (and pathname (probe-file pathname) (file-write-date pathname))1417 (or (and pathname (probe-file* pathname) (file-write-date pathname)) 1306 1418 (progn 1307 1419 (when (and pathname *asdf-verbose*) 1308 (warn "Missing FILE-WRITE-DATE for ~S: treating it as zero."1420 (warn (compatfmt "~@<Missing FILE-WRITE-DATE for ~S, treating it as zero.~@:>") 1309 1421 pathname)) 1310 1422 0))) … … 1318 1430 (unwind-protect 1319 1431 (handler-bind 1320 ((error (lambda (condition)1321 (error 'load-system-definition-error1322 :name name :pathname pathname1323 :condition condition))))1432 ((error #'(lambda (condition) 1433 (error 'load-system-definition-error 1434 :name name :pathname pathname 1435 :condition condition)))) 1324 1436 (let ((*package* package)) 1325 (asdf-message 1326 "~&~@<; ~@;Loading system definition from ~A into ~A~@:>~%" 1327 pathname package) 1437 (asdf-message (compatfmt "~&~@<; ~@;Loading system definition from ~A into ~A~@:>~%") 1438 pathname package) 1328 1439 (load pathname))) 1329 1440 (delete-package package)))) … … 1350 1461 1351 1462 (defun* register-system (name system) 1352 (asdf-message "~&~@<; ~@;Registering ~A as ~A~@:>~%" system name) 1353 (setf (gethash (coerce-name name) *defined-systems*) 1354 (cons (get-universal-time) system))) 1463 (setf name (coerce-name name)) 1464 (assert (equal name (component-name system))) 1465 (asdf-message (compatfmt "~&~@<; ~@;Registering ~3i~_~A~@:>~%") system) 1466 (setf (gethash name *defined-systems*) (cons (get-universal-time) system))) 1355 1467 1356 1468 (defun* find-system-fallback (requested fallback &rest keys &key source-file &allow-other-keys) … … 1428 1540 (source-file-explicit-type component)) 1429 1541 1430 (defun* merge-component-name-type (name &key type defaults) 1542 (defun* coerce-pathname (name &key type defaults) 1543 "coerce NAME into a PATHNAME. 1544 When given a string, portably decompose it into a relative pathname: 1545 #\\/ separates subdirectories. The last #\\/-separated string is as follows: 1546 if TYPE is NIL, its last #\\. if any separates name and type from from type; 1547 if TYPE is a string, it is the type, and the whole string is the name; 1548 if TYPE is :DIRECTORY, the string is a directory component; 1549 if the string is empty, it's a directory. 1550 Any directory named .. is read as :BACK. 1551 Host, device and version components are taken from DEFAULTS." 1431 1552 ;; The defaults are required notably because they provide the default host 1432 1553 ;; to the below make-pathname, which may crucially matter to people using 1433 1554 ;; merge-pathnames with non-default hosts, e.g. for logical-pathnames. 1434 1555 ;; NOTE that the host and device slots will be taken from the defaults, 1435 ;; but that should only matter if you either (a) use absolute pathnames, or 1436 ;; (b) later merge relative pathnames with CL:MERGE-PATHNAMES instead of 1437 ;; ASDF:MERGE-PATHNAMES* 1556 ;; but that should only matter if you later merge relative pathnames with 1557 ;; CL:MERGE-PATHNAMES instead of ASDF:MERGE-PATHNAMES* 1438 1558 (etypecase name 1439 ( pathname1559 ((or null pathname) 1440 1560 name) 1441 1561 (symbol 1442 ( merge-component-name-type (string-downcase name) :type type :defaults defaults))1562 (coerce-pathname (string-downcase name) :type type :defaults defaults)) 1443 1563 (string 1444 1564 (multiple-value-bind (relative path filename) … … 1453 1573 (t 1454 1574 (split-name-type filename))) 1455 (let* ((defaults (pathname (or defaults *default-pathname-defaults*))) 1456 (host (pathname-host defaults)) 1457 (device (pathname-device defaults))) 1458 (make-pathname :directory `(,relative ,@path) 1459 :name name :type type 1460 :host host :device device))))))) 1575 (make-pathname :directory `(,relative ,@path) :name name :type type 1576 :defaults (or defaults *default-pathname-defaults*))))))) 1577 1578 (defun* merge-component-name-type (name &key type defaults) 1579 ;; For backwards compatibility only, for people using internals. 1580 ;; Will be removed in a future release, e.g. 2.014. 1581 (coerce-pathname name :type type :defaults defaults)) 1461 1582 1462 1583 (defmethod component-relative-pathname ((component component)) 1463 ( merge-component-name-type1584 (coerce-pathname 1464 1585 (or (slot-value component 'relative-pathname) 1465 1586 (component-name component)) … … 1569 1690 (defmethod component-self-dependencies ((o operation) (c component)) 1570 1691 (let ((all-deps (component-depends-on o c))) 1571 (remove-if-not (lambda (x)1572 (member (component-name c) (cdr x) :test #'string=))1692 (remove-if-not #'(lambda (x) 1693 (member (component-name c) (cdr x) :test #'string=)) 1573 1694 all-deps))) 1574 1695 … … 1577 1698 (self-deps (component-self-dependencies operation c))) 1578 1699 (if self-deps 1579 (mapcan (lambda (dep)1580 (destructuring-bind (op name) dep1581 (output-files (make-instance op)1582 (find-component parent name))))1700 (mapcan #'(lambda (dep) 1701 (destructuring-bind (op name) dep 1702 (output-files (make-instance op) 1703 (find-component parent name)))) 1583 1704 self-deps) 1584 1705 ;; no previous operations needed? I guess we work with the … … 1634 1755 ;; second). So that's cool. 1635 1756 (and 1636 (every #'probe-file in-files)1637 (every #'probe-file out-files)1757 (every #'probe-file* in-files) 1758 (every #'probe-file* out-files) 1638 1759 (>= (earliest-out) (latest-in)))))))) 1639 1760 … … 1682 1803 (retry () 1683 1804 :report (lambda (s) 1684 (format s "~@<Retry loading component~S.~@:>" required-c))1805 (format s "~@<Retry loading component ~3i~_~S.~@:>" required-c)) 1685 1806 :test 1686 1807 (lambda (c) 1687 (or (null c)1688 (and (typep c 'missing-dependency)1689 (equalp (missing-requires c)1690 required-c))))))))1808 (or (null c) 1809 (and (typep c 'missing-dependency) 1810 (equalp (missing-requires c) 1811 required-c)))))))) 1691 1812 1692 1813 (defun* do-dep (operation c collect op dep) … … 1726 1847 (dep op (third d) nil))) 1727 1848 (t 1728 (error "Bad dependency ~a. Dependencies must be (:version <version>), (:feature <feature> [version]), or a name"d))))))1849 (error (compatfmt "~@<Bad dependency ~a. Dependencies must be (:version <version>), (:feature <feature> [version]), or a name.~@:>") d)))))) 1729 1850 flag)))) 1730 1851 … … 1851 1972 (defmethod perform ((operation operation) (c source-file)) 1852 1973 (sysdef-error 1853 "~@<required method PERFORM not implemented for operation ~A, component ~A~@:>"1974 (compatfmt "~@<Required method PERFORM not implemented for operation ~A, component ~A~@:>") 1854 1975 (class-of operation) (class-of c))) 1855 1976 … … 1862 1983 1863 1984 (defmethod operation-description (operation component) 1864 (format nil "~A on component ~S" (class-of operation) (component-find-path component))) 1985 (format nil (compatfmt "~@<~A on component ~S~@:>") 1986 (class-of operation) (component-find-path component))) 1865 1987 1866 1988 ;;;; ------------------------------------------------------------------------- … … 1874 1996 :initform *compile-file-failure-behaviour*) 1875 1997 (flags :initarg :flags :accessor compile-op-flags 1876 :initform #-ecl nil #+ecl '(:system-p t))))1998 :initform nil))) 1877 1999 1878 2000 (defun output-file (operation component) … … 1883 2005 1884 2006 (defmethod perform :before ((operation compile-op) (c source-file)) 1885 (map nil #'ensure-directories-exist (output-files operation c))) 1886 1887 #+ecl 1888 (defmethod perform :after ((o compile-op) (c cl-source-file)) 1889 ;; Note how we use OUTPUT-FILES to find the binary locations 1890 ;; This allows the user to override the names. 1891 (let* ((files (output-files o c)) 1892 (object (first files)) 1893 (fasl (second files))) 1894 (c:build-fasl fasl :lisp-files (list object)))) 2007 (loop :for file :in (asdf:output-files operation c) 2008 :for pathname = (if (typep file 'logical-pathname) 2009 (translate-logical-pathname file) 2010 file) 2011 :do (ensure-directories-exist pathname))) 1895 2012 1896 2013 (defmethod perform :after ((operation operation) (c component)) … … 1898 2015 (get-universal-time))) 1899 2016 1900 (declaim (ftype (function ((or pathname string) 1901 &rest t &key (:output-file t) &allow-other-keys) 1902 (values t t t)) 1903 compile-file*)) 2017 (defvar *compile-op-compile-file-function* 'compile-file* 2018 "Function used to compile lisp files.") 1904 2019 1905 2020 ;;; perform is required to check output-files to find out where to put … … 1914 2029 (*compile-file-failure-behaviour* (operation-on-failure operation))) 1915 2030 (multiple-value-bind (output warnings-p failure-p) 1916 (apply #'compile-file* source-file :output-file output-file2031 (apply *compile-op-compile-file-function* source-file :output-file output-file 1917 2032 (compile-op-flags operation)) 1918 2033 (when warnings-p 1919 2034 (case (operation-on-warnings operation) 1920 2035 (:warn (warn 1921 "~@<COMPILE-FILE warned while performing ~A on ~A.~@:>"2036 (compatfmt "~@<COMPILE-FILE warned while performing ~A on ~A.~@:>") 1922 2037 operation c)) 1923 2038 (:error (error 'compile-warned :component c :operation operation)) … … 1926 2041 (case (operation-on-failure operation) 1927 2042 (:warn (warn 1928 "~@<COMPILE-FILE failed while performing ~A on ~A.~@:>"2043 (compatfmt "~@<COMPILE-FILE failed while performing ~A on ~A.~@:>") 1929 2044 operation c)) 1930 2045 (:error (error 'compile-failed :component c :operation operation)) … … 1936 2051 (declare (ignorable operation)) 1937 2052 (let ((p (lispize-pathname (component-pathname c)))) 1938 #-:broken-fasl-loader 1939 (list (compile-file-pathname p #+ecl :type #+ecl :object) 1940 #+ecl (compile-file-pathname p :type :fasl)) 1941 #+:broken-fasl-loader (list p))) 2053 #-broken-fasl-loader (list (compile-file-pathname p)) 2054 #+broken-fasl-loader (list p))) 1942 2055 1943 2056 (defmethod perform ((operation compile-op) (c static-file)) … … 1965 2078 1966 2079 (defmethod perform ((o load-op) (c cl-source-file)) 1967 (map () #'load 1968 #-ecl (input-files o c) 1969 #+ecl (loop :for i :in (input-files o c) 1970 :unless (string= (pathname-type i) "fas") 1971 :collect (compile-file-pathname (lispize-pathname i))))) 2080 (map () #'load (input-files o c))) 1972 2081 1973 2082 (defmethod perform-with-restarts (operation component) … … 2034 2143 (defmethod operation-description ((operation load-op) component) 2035 2144 (declare (ignorable operation)) 2036 (format nil "loading component ~S" (component-find-path component))) 2145 (format nil (compatfmt "~@<Loading component: ~3i~_~S~@:>") 2146 (component-find-path component))) 2037 2147 2038 2148 … … 2062 2172 (let ((what-would-load-op-do (cdr (assoc 'load-op 2063 2173 (component-in-order-to c))))) 2064 (mapcar (lambda (dep)2065 (if (eq (car dep) 'load-op)2066 (cons 'load-source-op (cdr dep))2067 dep))2174 (mapcar #'(lambda (dep) 2175 (if (eq (car dep) 'load-op) 2176 (cons 'load-source-op (cdr dep)) 2177 dep)) 2068 2178 what-would-load-op-do))) 2069 2179 … … 2077 2187 (defmethod operation-description ((operation load-source-op) component) 2078 2188 (declare (ignorable operation)) 2079 (format nil "loading component ~S" (component-find-path component))) 2189 (format nil (compatfmt "~@<Loading component: ~3i~_~S~@:>") 2190 (component-find-path component))) 2080 2191 2081 2192 … … 2128 2239 :report 2129 2240 (lambda (s) 2130 (format s "~@<Retry ~A.~@:>" (operation-description op component)))) 2241 (format s (compatfmt "~@<Retry ~A.~@:>") 2242 (operation-description op component)))) 2131 2243 (accept () 2132 2244 :report 2133 2245 (lambda (s) 2134 (format s "~@<Continue, treating ~A as having been successful.~@:>" 2135 (operation-description op component)))2246 (format s (compatfmt "~@<Continue, treating ~A as having been successful.~@:>") 2247 (operation-description op component))) 2136 2248 (setf (gethash (type-of op) 2137 2249 (component-operation-times component)) … … 2211 2323 (let* ((file-pathname (load-pathname)) 2212 2324 (directory-pathname (and file-pathname (pathname-directory-pathname file-pathname)))) 2213 (or (and pathname-supplied-p (merge-pathnames* pathname directory-pathname)) 2325 (or (and pathname-supplied-p 2326 (merge-pathnames* (coerce-pathname pathname :type :directory) 2327 directory-pathname)) 2214 2328 directory-pathname 2215 2329 (default-directory)))) 2216 2330 2217 2331 (defmacro defsystem (name &body options) 2332 (setf name (coerce-name name)) 2218 2333 (destructuring-bind (&key (pathname nil pathname-arg-p) (class 'system) 2219 2334 defsystem-depends-on &allow-other-keys) … … 2225 2340 ;; to reuse options (e.g. pathname) from 2226 2341 ,@(loop :for system :in defsystem-depends-on 2227 :collect `(load-system ,system))2342 :collect `(load-system ',(coerce-name system))) 2228 2343 (let ((s (system-registered-p ',name))) 2229 2344 (cond ((and s (eq (type-of (cdr s)) ',class)) … … 2254 2369 (or (module-default-component-class parent) 2255 2370 (find-class *default-component-class*))) 2256 (sysdef-error " ~@<don't recognize component type ~A~@:>" type)))2371 (sysdef-error "don't recognize component type ~A" type))) 2257 2372 2258 2373 (defun* maybe-add-tree (tree op1 op2 c) … … 2286 2401 (defun* sysdef-error-component (msg type name value) 2287 2402 (sysdef-error (concatenate 'string msg 2288 "~&The value specified for ~(~A~) ~A is ~S")2403 (compatfmt "~&~@<The value specified for ~(~A~) ~A is ~S~@:>")) 2289 2404 type name value)) 2290 2405 … … 2311 2426 ;; methods will not be for this particular gf 2312 2427 ;; But this is hardly performance-critical 2313 (lambda (m)2314 (remove-method (symbol-function name) m))2428 #'(lambda (m) 2429 (remove-method (symbol-function name) m)) 2315 2430 (component-inline-methods component))) 2316 2431 ;; clear methods, then add the new ones … … 2513 2628 (defun* system-relative-pathname (system name &key type) 2514 2629 (merge-pathnames* 2515 ( merge-component-name-type name :type type)2630 (coerce-pathname name :type type) 2516 2631 (system-source-directory system))) 2517 2632 … … 2524 2639 2525 2640 (defparameter *implementation-features* 2526 '((:a cl :allegro)2527 (: lw :lispworks)2528 (: digitool) ; before clozure, so it won't get preempted by ccl2641 '((:abcl :armedbear) 2642 (:acl :allegro) 2643 (:mcl :digitool) ; before clozure, so it won't get preempted by ccl 2529 2644 (:ccl :clozure) 2530 2645 (:corman :cormanlisp) 2531 (: abcl :armedbear)2532 : sbcl :cmu :clisp :gcl :ecl :scl))2646 (:lw :lispworks) 2647 :clisp :cmu :ecl :gcl :sbcl :scl :symbolics)) 2533 2648 2534 2649 (defparameter *os-features* … … 2538 2653 (:macosx :darwin :darwin-target :apple) 2539 2654 :freebsd :netbsd :openbsd :bsd 2540 :unix)) 2655 :unix 2656 :genera)) 2541 2657 2542 2658 (defparameter *architecture-features* … … 2550 2666 (:sparc32 :sparc) 2551 2667 (:arm :arm-target) 2552 (:java :java-1.4 :java-1.5 :java-1.6 :java-1.7))) 2668 (:java :java-1.4 :java-1.5 :java-1.6 :java-1.7) 2669 :imach)) 2553 2670 2554 2671 (defun* lisp-version-string () … … 2568 2685 (if (member :64bit *features*) "-64bit" "")) 2569 2686 #+armedbear (format nil "~a-fasl~a" s system::*fasl-version*) 2570 #+clisp (subseq s 0 (position #\space s)) 2687 #+clisp (subseq s 0 (position #\space s)) ; strip build information (date, etc.) 2571 2688 #+clozure (format nil "~d.~d-f~d" ; shorten for windows 2572 2689 ccl::*openmcl-major-version* … … 2574 2691 (logand ccl::fasl-version #xFF)) 2575 2692 #+cmu (substitute #\- #\/ s) 2576 #+digitool (subseq s 8)2577 2693 #+ecl (format nil "~A~@[-~A~]" s 2578 2694 (let ((vcs-id (ext:lisp-implementation-vcs-id))) … … 2580 2696 (subseq vcs-id 0 8)))) 2581 2697 #+gcl (subseq s (1+ (position #\space s))) 2698 #+genera (multiple-value-bind (major minor) (sct:get-system-version "System") 2699 (format nil "~D.~D" major minor)) 2582 2700 #+lispworks (format nil "~A~@[~A~]" s 2583 2701 (when (member :lispworks-64bit *features*) "-64bit")) 2584 2702 ;; #+sbcl (format nil "~a-fasl~d" s sb-fasl:+fasl-file-version+) ; f-f-v redundant w/ version 2585 #+(or cormanlisp mcl sbcl scl) s 2586 #-(or allegro armedbear clisp clozure cmu cormanlisp digitool 2587 ecl gcl lispworks mcl sbcl scl) s)) 2703 #+mcl (subseq s 8) ; strip the leading "Version " 2704 #+(or cormanlisp sbcl scl) s 2705 #-(or allegro armedbear clisp clozure cmu cormanlisp 2706 ecl gcl genera lispworks mcl sbcl scl) s)) 2588 2707 2589 2708 (defun* first-feature (features) … … 2613 2732 "unknown")))) 2614 2733 (let ((lisp (maybe-warn (implementation-type) 2615 "No implementation feature found in ~a."2734 (compatfmt "~@<No implementation feature found in ~a.~@:>") 2616 2735 *implementation-features*)) 2617 2736 (os (maybe-warn (first-feature *os-features*) 2618 "No os feature found in ~a."*os-features*))2619 (arch #+clisp ""#-clisp2620 (maybe-warn (first-feature *architecture-features*)2621 "No architecture feature found in ~a."2622 *architecture-features*))2737 (compatfmt "~@<No OS feature found in ~a.~@:>") *os-features*)) 2738 (arch (or #-clisp 2739 (maybe-warn (first-feature *architecture-features*) 2740 (compatfmt "~@<No architecture feature found in ~a.~@:>") 2741 *architecture-features*))) 2623 2742 (version (maybe-warn (lisp-version-string) 2624 2743 "Don't know how to get Lisp implementation version."))) 2625 2744 (substitute-if 2626 #\_ (lambda (x) (find x " /:\\(){}[]$#`'\""))2627 (format nil "~(~ @{~a~^-~}~)" lisp version os arch)))))2745 #\_ #'(lambda (x) (find x " /:\\(){}[]$#`'\"")) 2746 (format nil "~(~a~@{~@[-~a~]~}~)" lisp version os arch))))) 2628 2747 2629 2748 … … 2632 2751 2633 2752 (defparameter *inter-directory-separator* 2634 #+ (or unix cygwin)#\:2635 #- (or unix cygwin)#\;)2753 #+asdf-unix #\: 2754 #-asdf-unix #\;) 2636 2755 2637 2756 (defun* user-homedir () 2638 (truenam e (user-homedir-pathname)))2757 (truenamize (pathname-directory-pathname (user-homedir-pathname)))) 2639 2758 2640 2759 (defun* try-directory-subpath (x sub &key type) 2641 2760 (let* ((p (and x (ensure-directory-pathname x))) 2642 2761 (tp (and p (probe-file* p))) 2643 (sp (and tp (merge-pathnames* ( merge-component-name-type sub :type type) p)))2762 (sp (and tp (merge-pathnames* (coerce-pathname sub :type type) p))) 2644 2763 (ts (and sp (probe-file* sp)))) 2645 2764 (and ts (values sp ts)))) … … 2652 2771 :for dir :in (split-string dirs :separator ":") 2653 2772 :collect (try dir "common-lisp/")) 2654 #+ (and (or win32 windows mswindows mingw32) (not cygwin))2773 #+asdf-windows 2655 2774 ,@`(#+lispworks ,(try (sys:get-folder-path :common-appdata) "common-lisp/config/") 2656 2775 ;;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\AppData … … 2661 2780 #'null 2662 2781 (append 2663 #+ (and (or win32 windows mswindows mingw32) (not cygwin))2782 #+asdf-windows 2664 2783 (flet ((try (x sub) (try-directory-subpath x sub :type :directory))) 2665 2784 `(,@`(#+lispworks ,(try (sys:get-folder-path :local-appdata) "common-lisp/config/") 2666 2785 ;;; read-windows-registry HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\User Shell Folders\Common AppData 2667 2786 ,(try (getenv "ALLUSERSPROFILE") "Application Data/common-lisp/config/")))) 2787 #+asdf-unix 2668 2788 (list #p"/etc/common-lisp/")))) 2669 2789 (defun* in-first-directory (dirs x) … … 2718 2838 (unless (= inherit 1) 2719 2839 (report-invalid-form invalid-form-reporter 2720 :arguments (list "One and only one of ~S or ~S is required"2840 :arguments (list (compatfmt "~@<One and only one of ~S or ~S is required.~@:>") 2721 2841 :inherit-configuration :ignore-inherited-configuration))) 2722 2842 (return (nreverse x)))) … … 2725 2845 (let ((forms (read-file-forms file))) 2726 2846 (unless (length=n-p forms 1) 2727 (error "One and only one form allowed for ~A. Got: ~S~%" description forms)) 2847 (error (compatfmt "~@<One and only one form allowed for ~A. Got: ~3i~_~S~@:>~%") 2848 description forms)) 2728 2849 (funcall validator (car forms) :location file))) 2729 2850 … … 2734 2855 (apply 'directory pathname-spec 2735 2856 (append keys '#.(or #+allegro '(:directories-are-files nil :follow-symbolic-links nil) 2736 #+c cl'(:follow-links nil)2857 #+clozure '(:follow-links nil) 2737 2858 #+clisp '(:circle t :if-does-not-exist :ignore) 2738 2859 #+(or cmu scl) '(:follow-links nil :truenamep nil) … … 2782 2903 (or 2783 2904 (try (getenv "XDG_CACHE_HOME") "common-lisp" :implementation) 2784 #+ (and (or win32 windows mswindows mingw32) (not cygwin))2905 #+asdf-windows 2785 2906 (try (getenv "APPDATA") "common-lisp" "cache" :implementation) 2786 2907 '(:home ".cache" "common-lisp" :implementation)))) … … 2797 2918 (list 2798 2919 (stable-sort (copy-list new-value) #'> 2799 :key (lambda (x)2800 (etypecase (car x)2801 ((eql t) -1)2802 (pathname2803 (let ((directory (pathname-directory (car x))))2804 (if (listp directory) (length directory) 0))))))))2920 :key #'(lambda (x) 2921 (etypecase (car x) 2922 ((eql t) -1) 2923 (pathname 2924 (let ((directory (pathname-directory (car x)))) 2925 (if (listp directory) (length directory) 0)))))))) 2805 2926 new-value) 2806 2927 … … 2841 2962 ((eql :implementation) (implementation-identifier)) 2842 2963 ((eql :implementation-type) (string-downcase (implementation-type))) 2843 # -(and (or win32 windows mswindows mingw32) (not cygwin))2964 #+asdf-unix 2844 2965 ((eql :uid) (princ-to-string (get-uid))))) 2845 2966 (d (if (or (pathnamep x) (not directory)) r (ensure-directory-pathname r))) 2846 2967 (s (if (or (pathnamep x) (not wilden)) d (wilden d)))) 2847 2968 (when (and (absolute-pathname-p s) (not (pathname-match-p s (wilden super)))) 2848 (error "pathname ~S is not relative to ~S"s super))2969 (error (compatfmt "~@<Pathname ~S is not relative to ~S~@:>") s super)) 2849 2970 (merge-pathnames* s super))) 2850 2971 … … 2888 3009 r))) 2889 3010 (unless (absolute-pathname-p s) 2890 (error "Not an absolute pathname ~S"s))3011 (error (compatfmt "~@<Not an absolute pathname: ~3i~_~S~@:>") s)) 2891 3012 s)) 2892 3013 … … 2912 3033 (member :default-directory :*/ :**/ :*.*.* 2913 3034 :implementation :implementation-type 2914 # -(and (or win32 windows mswindows mingw32) (not cygwin)):uid)))))3035 #+asdf-unix :uid))))) 2915 3036 (or (typep x 'boolean) 2916 3037 (absolute-component-p x) … … 2960 3081 '(:output-translations :inherit-configuration)) 2961 3082 ((not (stringp string)) 2962 (error "environment string isn't: ~S"string))3083 (error (compatfmt "~@<Environment string isn't: ~3i~_~S~@:>") string)) 2963 3084 ((eql (char string 0) #\") 2964 3085 (parse-output-translations-string (read-from-string string) :location location)) … … 2980 3101 ((equal "" s) 2981 3102 (when inherit 2982 (error "only one inherited configuration allowed: ~S" string)) 3103 (error (compatfmt "~@<Only one inherited configuration allowed: ~3i~_~S~@:>") 3104 string)) 2983 3105 (setf inherit t) 2984 3106 (push :inherit-configuration directives)) … … 2988 3110 (when (> start end) 2989 3111 (when source 2990 (error "Uneven number of components in source to destination mapping ~S" string)) 3112 (error (compatfmt "~@<Uneven number of components in source to destination mapping: ~3i~_~S~@:>") 3113 string)) 2991 3114 (unless inherit 2992 3115 (push :ignore-inherited-configuration directives)) … … 3004 3127 ;; Some implementations have precompiled ASDF systems, 3005 3128 ;; so we must disable translations for implementation paths. 3006 #+sbcl ,(let ((h (getenv "SBCL_HOME"))) (when (plusp (length h)) `(,h ()))) 3129 #+sbcl ,(let ((h (getenv "SBCL_HOME"))) 3130 (when (plusp (length h)) `((,(truenamize h) ,*wild-inferiors*) ()))) 3007 3131 #+ecl (,(translate-logical-pathname "SYS:**;*.*") ()) ; not needed: no precompiled ASDF system 3008 3132 #+clozure ,(ignore-errors (list (wilden (let ((*default-pathname-defaults* #p"")) (truename #p"ccl:"))) ())) ; not needed: no precompiled ASDF system … … 3015 3139 :enable-user-cache)) 3016 3140 3017 (defparameter *output-translations-file* #p"asdf-output-translations.conf")3018 (defparameter *output-translations-directory* #p"asdf-output-translations.conf.d/")3141 (defparameter *output-translations-file* (coerce-pathname "asdf-output-translations.conf")) 3142 (defparameter *output-translations-directory* (coerce-pathname "asdf-output-translations.conf.d/")) 3019 3143 3020 3144 (defun* user-output-translations-pathname () … … 3044 3168 (process-output-translations (validate-output-translations-directory pathname) 3045 3169 :inherit inherit :collect collect)) 3046 ((probe-file pathname)3170 ((probe-file* pathname) 3047 3171 (process-output-translations (validate-output-translations-file pathname) 3048 3172 :inherit inherit :collect collect)) … … 3107 3231 :test 'equal :from-end t)) 3108 3232 3109 (defun* initialize-output-translations (&optional parameter) 3233 (defvar *output-translations-parameter* nil) 3234 3235 (defun* initialize-output-translations (&optional (parameter *output-translations-parameter*)) 3110 3236 "read the configuration, initialize the internal configuration variable, 3111 3237 return the configuration" 3112 (setf (output-translations) (compute-output-translations parameter))) 3238 (setf *output-translations-parameter* parameter 3239 (output-translations) (compute-output-translations parameter))) 3113 3240 3114 3241 (defun* disable-output-translations () … … 3135 3262 path) 3136 3263 ((not (pathnamep destination)) 3137 (error " invalid destination"))3264 (error "Invalid destination")) 3138 3265 ((not (absolute-pathname-p destination)) 3139 3266 (translate-pathname path absolute-source (merge-pathnames* destination root))) … … 3186 3313 3187 3314 (defun* delete-file-if-exists (x) 3188 (when (and x (probe-file x))3315 (when (and x (probe-file* x)) 3189 3316 (delete-file x))) 3190 3317 … … 3279 3406 ;;;; http://www.wotsit.org/list.asp?fc=13 3280 3407 3281 #+(and (or win32 windows mswindows mingw32) (not cygwin)(not clisp))3408 #+(and asdf-windows (not clisp)) 3282 3409 (progn 3283 3410 (defparameter *link-initial-dword* 76) … … 3389 3516 (defun directory-has-asd-files-p (directory) 3390 3517 (ignore-errors 3391 (directory* (merge-pathnames* *wild-asd* directory)) 3392 t)) 3518 (and (directory* (merge-pathnames* *wild-asd* directory)) t))) 3393 3519 3394 3520 (defun subdirectories (directory) 3395 3521 (let* ((directory (ensure-directory-pathname directory)) 3396 #- cormanlisp3522 #-(or cormanlisp genera) 3397 3523 (wild (merge-pathnames* 3398 3524 #-(or abcl allegro lispworks scl) … … 3401 3527 directory)) 3402 3528 (dirs 3403 #- cormanlisp3529 #-(or cormanlisp genera) 3404 3530 (ignore-errors 3405 (directory* wild . #.(or #+ccl '(:directories t :files nil) 3406 #+digitool '(:directories t)))) 3407 #+cormanlisp (cl::directory-subdirs directory)) 3408 #+(or abcl allegro lispworks scl) 3531 (directory* wild . #.(or #+clozure '(:directories t :files nil) 3532 #+mcl '(:directories t)))) 3533 #+cormanlisp (cl::directory-subdirs directory) 3534 #+genera (fs:directory-list directory)) 3535 #+(or abcl allegro genera lispworks scl) 3409 3536 (dirs (remove-if-not #+abcl #'extensions:probe-directory 3410 3537 #+allegro #'excl:probe-directory 3411 3538 #+lispworks #'lw:file-directory-p 3412 #-(or abcl allegro lispworks) #'directory-pathname-p 3413 dirs))) 3539 #+genera #'(lambda (x) (getf (cdr x) :directory)) 3540 #-(or abcl allegro genera lispworks) #'directory-pathname-p 3541 dirs)) 3542 #+genera 3543 (dirs (mapcar #'(lambda (x) (ensure-directory-pathname (first x))) dirs))) 3414 3544 dirs)) 3415 3545 … … 3463 3593 '(:source-registry :inherit-configuration)) 3464 3594 ((not (stringp string)) 3465 (error "environment string isn't: ~S"string))3595 (error (compatfmt "~@<Environment string isn't: ~3i~_~S~@:>") string)) 3466 3596 ((find (char string 0) "\"(") 3467 3597 (validate-source-registry-form (read-from-string string) :location location)) … … 3477 3607 ((equal "" s) ; empty element: inherit 3478 3608 (when inherit 3479 (error "only one inherited configuration allowed: ~S" string)) 3609 (error (compatfmt "~@<Only one inherited configuration allowed: ~3i~_~S~@:>") 3610 string)) 3480 3611 (setf inherit t) 3481 3612 (push ':inherit-configuration directives)) … … 3506 3637 default-source-registry)) 3507 3638 3508 (defparameter *source-registry-file* #p"source-registry.conf")3509 (defparameter *source-registry-directory* #p"source-registry.conf.d/")3639 (defparameter *source-registry-file* (coerce-pathname "source-registry.conf")) 3640 (defparameter *source-registry-directory* (coerce-pathname "source-registry.conf.d/")) 3510 3641 3511 3642 (defun* wrapping-source-registry () 3512 3643 `(:source-registry 3513 #+sbcl (:tree ,( getenv "SBCL_HOME"))3644 #+sbcl (:tree ,(truenamize (getenv "SBCL_HOME"))) 3514 3645 :inherit-configuration 3515 3646 #+cmu (:tree #p"modules:"))) … … 3518 3649 `(:source-registry 3519 3650 #+sbcl (:directory ,(merge-pathnames* ".sbcl/systems/" (user-homedir))) 3520 (:directory ,( truenamize (directory-namestring *default-pathname-defaults*)))3651 (:directory ,(default-directory)) 3521 3652 ,@(let* 3522 #+ (or unix cygwin)3653 #+asdf-unix 3523 3654 ((datahome 3524 3655 (or (getenv "XDG_DATA_HOME") … … 3527 3658 (or (getenv "XDG_DATA_DIRS") "/usr/local/share:/usr/share")) 3528 3659 (dirs (cons datahome (split-string datadirs :separator ":")))) 3529 #+ (and (or win32 windows mswindows mingw32) (not cygwin))3660 #+asdf-windows 3530 3661 ((datahome (getenv "APPDATA")) 3531 3662 (datadir … … 3534 3665 "Application Data")) 3535 3666 (dirs (list datahome datadir))) 3536 #-(or unix win32 windows mswindows mingw32 cygwin)3667 #-(or asdf-unix asdf-windows) 3537 3668 ((dirs ())) 3538 3669 (loop :for dir :in dirs … … 3565 3696 (process-source-registry (validate-source-registry-directory pathname) 3566 3697 :inherit inherit :register register))) 3567 ((probe-file pathname)3698 ((probe-file* pathname) 3568 3699 (let ((*here-directory* (pathname-directory-pathname pathname))) 3569 3700 (process-source-registry (validate-source-registry-file pathname) … … 3621 3752 ,parameter 3622 3753 ,@*default-source-registries*) 3623 :register (lambda (directory &key recurse exclude)3624 (collect (list directory :recurse recurse :exclude exclude)))))3754 :register #'(lambda (directory &key recurse exclude) 3755 (collect (list directory :recurse recurse :exclude exclude))))) 3625 3756 :test 'equal :from-end t))) 3626 3757 … … 3635 3766 :recurse recurse :exclude exclude :collect #'collect))))) 3636 3767 3637 (defun* initialize-source-registry (&optional parameter) 3638 (setf (source-registry) (compute-source-registry parameter))) 3768 (defvar *source-registry-parameter* nil) 3769 3770 (defun* initialize-source-registry (&optional (parameter *source-registry-parameter*)) 3771 (setf *source-registry-parameter* parameter 3772 (source-registry) (compute-source-registry parameter))) 3639 3773 3640 3774 ;; Checks an initial variable to see whether the state is initialized … … 3669 3803 ((style-warning #'muffle-warning) 3670 3804 (missing-component (constantly nil)) 3671 (error (lambda (e)3672 (format *error-output* "ASDF could not load ~(~A~) because ~A.~%"3673 name e))))3674 (let *((*verbose-out* (make-broadcast-stream))3805 (error #'(lambda (e) 3806 (format *error-output* (compatfmt "~@<ASDF could not load ~(~A~) because ~A.~@:>~%") 3807 name e)))) 3808 (let ((*verbose-out* (make-broadcast-stream)) 3675 3809 (system (find-system (string-downcase name) nil))) 3676 3810 (when system 3677 (load-system system) 3678 t)))) 3811 (load-system system))))) 3679 3812 3680 3813 #+(or abcl clisp clozure cmu ecl sbcl) … … 3695 3828 ;;;; See https://bugs.launchpad.net/asdf/+bug/485687 3696 3829 ;;;; 3697 ;;;; TODO: debug why it's not enough to upgrade from ECL <= 9.11.13698 (eval-when (:compile-toplevel :load-toplevel :execute)3699 #+ecl ;; Support upgrade from before ECL went to 1.3693700 (when (fboundp 'compile-op-system-p)3701 (defmethod compile-op-system-p ((op compile-op))3702 (getf :system-p (compile-op-flags op)))3703 (defmethod initialize-instance :after ((op compile-op)3704 &rest initargs3705 &key system-p &allow-other-keys)3706 (declare (ignorable initargs))3707 (when system-p (appendf (compile-op-flags op) (list :system-p system-p))))))3708 3830 3709 3831 ;;; If a previous version of ASDF failed to read some configuration, try again.
Note:
See TracChangeset
for help on using the changeset viewer.
