Changeset 12765
- Timestamp:
- 06/25/10 10:46:06 (13 years ago)
- Location:
- trunk/abcl
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/abcl/doc/asdf/asdf.texinfo
r12655 r12765 171 171 172 172 @emph{Nota Bene}: 173 We are preparing for a release of ASDF 2, hopefully for May 2010, 174 which will have version 2.000 and later. 175 Current releases, in the 1.700 series and beyond, 176 should be considered as release candidates. 177 We're still working on polishing the code and documentation. 173 We have released ASDF 2.000 on May 31st 2010. 174 It hopefully will have been it included 175 in all CL maintained implementations shortly afterwards. 178 176 @xref{FAQ,,``What has changed between ASDF 1 and ASDF 2?''}. 179 177 … … 242 240 If it returns @code{NIL} then ASDF is not installed. 243 241 244 If you are running a version older than 1.711,242 If you are running a version older than 2.000, 245 243 we recommend that you load a newer ASDF using the method below. 246 244 … … 341 339 342 340 The simplest way to add a path to your search path, 343 say @file{/ foo/bar/baz/quux/}341 say @file{/home/luser/.asd-link-farm/} 344 342 is to create the directory 345 343 @file{~/.config/common-lisp/source-registry.conf.d/} 346 and there create a file with any name of your choice ,347 for instance @file{42- bazquux.conf}344 and there create a file with any name of your choice but the type @file{conf}, 345 for instance @file{42-asd-link-farm.conf} 348 346 containing the line: 349 347 350 @kbd{(:directory "/ foo/bar/baz/quux/")}351 352 If you want all the subdirectories under @file{/ foo/bar/baz/}348 @kbd{(:directory "/home/luser/.asd-link-farm/")} 349 350 If you want all the subdirectories under @file{/home/luser/lisp/} 353 351 to be recursively scanned for @file{.asd} files, instead use: 354 352 355 @kbd{(:tree "/ foo/bar/baz/quux/")}353 @kbd{(:tree "/home/luser/lisp/")} 356 354 357 355 Note that your Operating System distribution or your system administrator 358 356 may already have configured system-managed libraries for you. 359 357 360 Also note that when choosing a filename, the convention is to use 361 the @file{.conf} extension 362 (and a non-empty extension is required for CLISP compatibility), 363 and it is customary to start the filename with two digits 358 The required @file{.conf} extension allows you to have disabled files 359 or editor backups (ending in @file{~}), and works portably 360 (for instance, it is a pain to allow both empty and non-empty extension on CLISP). 361 Excluded are files the name of which start with a @file{.} character. 362 It is customary to start the filename with two digits 364 363 that specify the order in which the directories will be scanned. 365 364 … … 486 485 is to create the directory 487 486 @file{~/.config/common-lisp/asdf-output-translations.conf.d/} 488 and there create a file with any name of your choice ,487 and there create a file with any name of your choice and the type @file{conf}, 489 488 for instance @file{42-bazquux.conf} 490 489 containing the line: … … 511 510 @xref{Controlling where ASDF searches for systems}, for full details. 512 511 513 514 Also note that when choosing a filename, the convention is to use 515 the @file{.conf} extension 516 (and a non-empty extension is required for CLISP compatibility), 517 and it is customary to start the filename with two digits512 The required @file{.conf} extension allows you to have disabled files 513 or editor backups (ending in @file{~}), and works portably 514 (for instance, it is a pain to allow both empty and non-empty extension on CLISP). 515 Excluded are files the name of which start with a @file{.} character. 516 It is customary to start the filename with two digits 518 517 that specify the order in which the directories will be scanned. 519 518 … … 536 535 ASDF-Binary-Locations, cl-launch, common-lisp-controller. 537 536 ASDF-Binary-Locations is now not needed anymore and should not be used. 538 cl-launch 2.900 and common-lisp-controller 7.1have been updated537 cl-launch 3.000 and common-lisp-controller 7.2 have been updated 539 538 to just delegate this functionality to ASDF. 540 539 … … 814 813 815 814 @subsection Pathname specifiers 815 @cindex pathname specifiers 816 816 817 817 A pathname specifier (@code{pathname-specifier}) … … 846 846 will be interpreted as the pathname @file{#p"foo/bar.quux"}. 847 847 848 ASDF does not interpret the string @code{".."} to designate the parent 849 directory. This string will be passed through to the underlying 850 operating system for interpretation. We @emph{believe} that this will 851 work on all platforms where ASDF is deployed, but do not guarantee this 852 behavior. A pathname object with a relative directory component of 853 @code{:up} or @code{:back} is the only guaranteed way to specify a 854 parent directory. 855 848 856 If a symbol is given, it will be translated into a string, 849 857 and downcased in the process. … … 857 865 which is reported not to work on some implementations. 858 866 859 Pathname sobjects may be given to override the path for a component.867 Pathname objects may be given to override the path for a component. 860 868 Such objects are typically specified using reader macros such as @code{#p} 861 869 or @code{#.(make-pathname ...)}. 862 Note however, that @code{#p...} is a short for @code{#.(parse-namestring ...)}863 and that the behavior @code{parse-namestring} is completely non-portable,864 unless you are using Common Lisp @code{logical-pathname}s .865 (@ xref{The defsystem grammar,,Warning about logical pathnames}, below.)870 Note however, that @code{#p...} is a shorthand for @code{#.(parse-namestring ...)} 871 and that the behavior of @code{parse-namestring} is completely non-portable, 872 unless you are using Common Lisp @code{logical-pathname}s 873 (@pxref{The defsystem grammar,,Warning about logical pathnames}, below). 866 874 Pathnames made with @code{#.(make-pathname ...)} 867 875 can usually be done more easily with the string syntax above. 868 876 The only case that you really need a pathname object is to override 869 877 the component-type default file type for a given component. 870 Therefore, it is a rare case that pathname objects should be used at all.878 Therefore, pathname objects should only rarely be used. 871 879 Unhappily, ASDF 1 didn't properly support 872 880 parsing component names as strings specifying paths with directories, 873 881 and the cumbersome @code{#.(make-pathname ...)} syntax had to be used. 874 Note that when specifying pathname objects, no magic interpretation of the pathname 875 is made depending on the component type. 882 883 Note that when specifying pathname objects, 884 ASDF does not do any special interpretation of the pathname 885 influenced by the component type, unlike the procedure for 886 pathname-specifying strings. 876 887 On the one hand, you have to be careful to provide a pathname that correctly 877 888 fulfills whatever constraints are required from that component type … … 882 893 883 894 @subsection Warning about logical pathnames 895 @cindex logical pathnames 896 897 We recommend that you not use logical pathnames 898 in your asdf system definitions at this point, 899 but logical pathnames @emph{are} supported. 884 900 885 901 To use logical pathnames, … … 889 905 890 906 You only have to specify such logical pathname for your system or 891 some top-level component, as sub-components using the usual string syntax 892 for names will be properly merged with the pathname of their parent. 907 some top-level component. Sub-components' relative pathnames, specified 908 using the string syntax 909 for names, will be properly merged with the pathnames of their parents. 893 910 The specification of a logical pathname host however is @emph{not} 894 911 otherwise directly supported in the ASDF syntax 895 912 for pathname specifiers as strings. 896 913 897 Logical pathnames are not specifically recommended to newcomers, 898 but are otherwise supported. 899 Moreover, the @code{asdf-output-translation} layer will 900 avoid trying to resolve and translate logical-pathnames, 901 so you can define yourself what translations you want to use 914 The @code{asdf-output-translation} layer will 915 avoid trying to resolve and translate logical-pathnames. 916 The advantage of this is that you can define yourself what translations you want to use 902 917 with the logical pathname facility. 903 904 The user of logical pathnames will have to configure logical pathnames himself, 905 before they may be used, and ASDF provides no specific support for that. 918 The disadvantage is that if you do not define such translations, any 919 system that uses logical pathnames will be have differently under 920 asdf-output-translations than other systems you use. 921 922 If you wish to use logical pathnames you will have to configure the 923 translations yourself before they may be used. 924 ASDF currently provides no specific support 925 for defining logical pathname translations. 906 926 907 927 908 928 @subsection Serial dependencies 929 @cindex serial dependencies 909 930 910 931 If the @code{:serial t} option is specified for a module, … … 914 935 915 936 @lisp 937 :serial t 916 938 :components ((:file "a") (:file "b") (:file "c")) 917 :serial t918 939 @end lisp 919 940 … … 1714 1735 ;; A directive is one of the following: 1715 1736 DIRECTIVE := 1737 ;; INHERITANCE DIRECTIVE: 1738 ;; Your configuration expression MUST contain 1739 ;; exactly one of either of these: 1740 :inherit-configuration | ; splices inherited configuration (often specified last) 1741 :ignore-inherited-configuration | ; drop inherited configuration (specified anywhere) 1742 1716 1743 ;; add a single directory to be scanned (no recursion) 1717 1744 (:directory DIRECTORY-PATHNAME-DESIGNATOR) | … … 1720 1747 (:tree DIRECTORY-PATHNAME-DESIGNATOR) | 1721 1748 1722 ;; override the default defaults for exclusion patterns1749 ;; override the defaults for exclusion patterns 1723 1750 (:exclude PATTERN ...) | 1751 ;; augment the defaults for exclusion patterns 1752 (:also-exclude PATTERN ...) | 1724 1753 1725 1754 ;; splice the parsed contents of another config file 1726 1755 (:include REGULAR-FILE-PATHNAME-DESIGNATOR) | 1727 1728 ;; Your configuration expression MUST contain1729 ;; exactly one of either of these:1730 :inherit-configuration | ; splices contents of inherited configuration1731 :ignore-inherited-configuration | ; drop contents of inherited configuration1732 1756 1733 1757 ;; This directive specifies that some default must be spliced. … … 1737 1761 against the name of a any subdirectory in the directory component 1738 1762 of a path. e.g. @code{"_darcs"} will match @file{#p"/foo/bar/_darcs/src/bar.asd"} 1763 @end example 1764 1765 For instance, as a simple case, my @file{~/.config/common-lisp/source-registry.conf}, 1766 which is the default place ASDF looks for this configuration, 1767 once contained: 1768 @example 1769 (:source-registry 1770 (:tree "/home/fare/cl/") 1771 :inherit-configuration) 1739 1772 @end example 1740 1773 … … 1747 1780 the lists of directives of these files with be concatenated in order. 1748 1781 An implicit @code{:inherit-configuration} will be included 1749 at the endof the list.1782 at the @emph{end} of the list. 1750 1783 1751 1784 This allows for packaging software that has file granularity … … 1765 1798 @example 1766 1799 (:include "/foo/bar/") 1800 @end example 1801 1802 Hence, to achieve the same effect as 1803 my example @file{~/.config/common-lisp/source-registry.conf} above, 1804 I could simply create a file 1805 @file{~/.config/common-lisp/source-registry.conf.d/33-home-fare-cl.conf} 1806 alone in its directory with the following contents: 1807 @example 1808 (:tree "/home/fare/cl/") 1767 1809 @end example 1768 1810 … … 1809 1851 If none is found, the search continues. 1810 1852 1811 Exclude statements specify patterns of subdirectories the systems of which 1812 to ignore. Typically you don't want to use copies of files kept by such 1853 Exclude statements specify patterns of subdirectories 1854 the systems from which to ignore. 1855 Typically you don't want to use copies of files kept by such 1813 1856 version control systems as Darcs. 1857 Exclude statements are not propagated to further included or inherited 1858 configuration files or expressions; 1859 instead the defaults are reset around every configuration statement 1860 to the default defaults from @code{asdf::*default-source-registry-exclusions*}. 1814 1861 1815 1862 Include statements cause the search to recurse with the path specifications … … 2058 2105 Recent versions of same packages use 2059 2106 the new @code{asdf-output-translations} API as defined below: 2060 @code{common-lisp-controller} (7. 1) and @code{cl-launch} (3.00);2107 @code{common-lisp-controller} (7.2) and @code{cl-launch} (3.000). 2061 2108 @code{ASDF-Binary-Locations} is fully superseded and not to be used anymore. 2062 2109 … … 2111 2158 ;; A directive is one of the following: 2112 2159 DIRECTIVE := 2160 ;; INHERITANCE DIRECTIVE: 2161 ;; Your configuration expression MUST contain 2162 ;; exactly one of either of these: 2163 :inherit-configuration | ; splices inherited configuration (often specified last) 2164 :ignore-inherited-configuration | ; drop inherited configuration (specified anywhere) 2165 2113 2166 ;; include a configuration file or directory 2114 2167 (:include PATHNAME-DESIGNATOR) | 2115 2116 ;; Your configuration expression MUST contain2117 ;; exactly one of either of these:2118 :inherit-configuration | ; splices contents of inherited configuration2119 :ignore-inherited-configuration | ; drop contents of inherited configuration2120 2168 2121 2169 ;; enable global cache in ~/.common-lisp/cache/sbcl-1.0.35-x86-64/ or something. … … 2233 2281 the lists of directives of these files with be concatenated in order. 2234 2282 An implicit @code{:inherit-configuration} will be included 2235 at the endof the list.2283 at the @emph{end} of the list. 2236 2284 2237 2285 This allows for packaging software that has file granularity … … 2495 2543 @subsection What are ASDF 1 and ASDF 2? 2496 2544 2497 We are preparing for a release of ASDF 2, 2498 which will have version 2.000 and later. 2499 While the code and documentation are essentially complete 2500 we are still working on polishing them before release. 2501 2502 Releases in the 1.700 series and beyond 2503 should be considered as release candidates. 2504 For all practical purposes, 2505 ASDF 2 refers to releases later than 1.656, 2506 and ASDF 1 to any release earlier than 1.369 or so. 2507 If your ASDF doesn't have a version, it's old. 2508 2509 ASDF 2 release candidates and beyond will have 2545 On May 31st 2010, we have released ASDF 2. 2546 ASDF 2 refers to release 2.000 and later. 2547 (Releases between 1.656 and 1.728 were development releases for ASDF 2.) 2548 ASDF 1 to any release earlier than 1.369 or so. 2549 If your ASDF doesn't sport a version, it's an old ASDF 1. 2550 2551 ASDF 2 and its release candidates push 2510 2552 @code{:asdf2} onto @code{*features*} so that if you are writing 2511 2553 ASDF-dependent code you may check for this feature … … 2514 2556 2515 2557 If you are experiencing problems or limitations of any sort with ASDF 1, 2516 we recommend that you should upgrade to ASDF 2 or its latest release candidate. 2558 we recommend that you should upgrade to ASDF 2, 2559 or whatever is the latest release. 2517 2560 2518 2561 … … 2538 2581 @code{asdf::merge-component-name-type}. 2539 2582 2583 On the other hand, there are places where systems used to accept namestrings 2584 where you must now use an explicit pathname object: 2585 @code{(defsystem ... :pathname "LOGICAL-HOST:PATH;TO;SYSTEM;" ...)} 2586 must now be written with the @code{#p} syntax: 2587 @code{(defsystem ... :pathname #p"LOGICAL-HOST:PATH;TO;SYSTEM;" ...)} 2588 2540 2589 @xref{The defsystem grammar,,Pathname specifiers}. 2541 2590 … … 2636 2685 The internal test suite used to massively fail on many implementations. 2637 2686 While still incomplete, it now fully passes 2638 on all implementations supported by the test suite. 2687 on all implementations supported by the test suite, 2688 except for GCL (due to GCL bugs). 2639 2689 2640 2690 @item 2641 2691 Support was lacking for some implementations. 2642 ABCL wasnotably wholly broken.2692 ABCL and GCL were notably wholly broken. 2643 2693 ECL extensions were not integrated in the ASDF release. 2644 2694 … … 2661 2711 that everyone can rely on from now on. 2662 2712 Use @code{#+asdf2} to detect presence of ASDF 2, 2663 @code{(asdf:version-satisfies (asdf:asdf-version) " 1.711")}2713 @code{(asdf:version-satisfies (asdf:asdf-version) "2.000")} 2664 2714 to check the availability of a version no earlier than required. 2665 2715 … … 2733 2783 @pxref{Controlling where ASDF saves compiled files,,Backward Compatibility}. 2734 2784 But thou shall not load ABL on top of ASDF 2. 2785 2786 @item 2787 ASDF pathname designators are now specified in places where they were unspecified, 2788 and a few small adjustments have to be made to some non-portable defsystems. 2789 Notably, in the @code{:pathname} argument to a @code{defsystem} and its components, 2790 a logical pathname (or implementation-dependent hierarchical pathname) 2791 must now be specified with @code{#p} syntax 2792 where the namestring might have previously sufficed; 2793 moreover when evaluation is desired @code{#.} must be used, 2794 where it wasn't necessary in the toplevel @code{:pathname} argument. 2735 2795 2736 2796 @end itemize … … 3090 3150 @section Missing bits in implementation 3091 3151 3092 ** all of the above3093 3094 3152 ** reuse the same scratch package whenever a system is reloaded from disk 3095 3096 ** rules for system pathname defaulting are not yet implemented properly3097 3153 3098 3154 ** proclamations probably aren't … … 3103 3159 like take the list of kids and @code{setf} the slot to @code{nil}, 3104 3160 then transfer children from old to new list as they're found. 3105 3106 ** traverse may become a normal function3107 3108 If you're defining methods on @code{traverse}, speak up.3109 3110 3111 ** a lot of load-op methods can be rewritten to use input-files3112 3113 so should be.3114 3115 3161 3116 3162 ** (stuff that might happen later) -
trunk/abcl/src/org/armedbear/lisp/asdf.lisp
r12666 r12765 48 48 #+xcvb (module ()) 49 49 50 (cl:in-package :cl-user) 51 52 (declaim (optimize (speed 2) (debug 2) (safety 3)) 53 #+sbcl (sb-ext:muffle-conditions sb-ext:compiler-note)) 54 55 #+ecl (require :cmp) 56 57 ;;;; Create packages in a way that is compatible with hot-upgrade. 58 ;;;; See https://bugs.launchpad.net/asdf/+bug/485687 59 ;;;; See more at the end of the file. 60 61 #+gcl 62 (eval-when (:compile-toplevel :load-toplevel) 63 (defpackage :asdf-utilities (:use :cl)) 64 (defpackage :asdf (:use :cl :asdf-utilities))) 65 66 (eval-when (:load-toplevel :compile-toplevel :execute) 50 (cl:in-package :cl) 51 (defpackage :asdf-bootstrap (:use :cl)) 52 (in-package :asdf-bootstrap) 53 54 ;; Implementation-dependent tweaks 55 (eval-when (:compile-toplevel :load-toplevel :execute) 56 ;; (declaim (optimize (speed 2) (debug 2) (safety 3)) ; NO: rely on the implementation defaults. 67 57 #+allegro 68 58 (setf excl::*autoload-package-name-alist* 69 59 (remove "asdf" excl::*autoload-package-name-alist* 70 60 :test 'equalp :key 'car)) 71 (let* ((asdf-version 72 ;; the 1+ helps the version bumping script discriminate 73 (subseq "VERSION:1.719" (1+ (length "VERSION")))) 61 #+ecl (require :cmp) 62 #+gcl 63 (eval-when (:compile-toplevel :load-toplevel) 64 (defpackage :asdf-utilities (:use :cl)) 65 (defpackage :asdf (:use :cl :asdf-utilities)))) 66 67 ;;;; Create packages in a way that is compatible with hot-upgrade. 68 ;;;; See https://bugs.launchpad.net/asdf/+bug/485687 69 ;;;; See more at the end of the file. 70 71 (eval-when (:load-toplevel :compile-toplevel :execute) 72 (let* ((asdf-version ;; the 1+ helps the version bumping script discriminate 73 (subseq "VERSION:2.003" (1+ (length "VERSION")))) ; NB: same as 2.105. 74 74 (existing-asdf (find-package :asdf)) 75 75 (vername '#:*asdf-version*) … … 81 81 #-gcl 82 82 (when existing-asdf 83 (format * error-output*83 (format *trace-output* 84 84 "~&Upgrading ASDF package ~@[from version ~A ~]to version ~A~%" 85 85 existing-version asdf-version)) … … 156 156 ((pkgdcl (name &key nicknames use export 157 157 redefined-functions unintern fmakunbound shadow) 158 `(ensure-package 159 ',name :nicknames ',nicknames :use ',use :export ',export 160 :shadow ',shadow 161 :unintern ',(append #-(or gcl ecl) redefined-functions 162 unintern) 163 :fmakunbound ',(append #+(or gcl ecl) redefined-functions 164 fmakunbound)))) 158 `(ensure-package 159 ',name :nicknames ',nicknames :use ',use :export ',export 160 :shadow ',shadow 161 :unintern ',(append #-(or gcl ecl) redefined-functions unintern) 162 :fmakunbound ',(append fmakunbound)))) 165 163 (pkgdcl 166 164 :asdf-utilities … … 291 289 #:ensure-output-translations 292 290 #:apply-output-translations 291 #:compile-file* 293 292 #:compile-file-pathname* 294 293 #:enable-asdf-binary-locations-compatibility … … 328 327 ((m module) added deleted plist &key) 329 328 (declare (ignorable deleted plist)) 329 (format *trace-output* "Updating ~A~%" m) 330 330 (when (member 'components-by-name added) 331 331 (compute-module-components-by-name m)))))) … … 337 337 "Exported interface to the version of ASDF currently installed. A string. 338 338 You can compare this string with e.g.: 339 (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSION) \" 1.704\")."339 (ASDF:VERSION-SATISFIES (ASDF:ASDF-VERSION) \"2.000\")." 340 340 *asdf-version*) 341 341 … … 345 345 Defaults to `t`.") 346 346 347 (defvar *compile-file-warnings-behaviour* :warn) 348 349 (defvar *compile-file-failure-behaviour* #+sbcl :error #-sbcl :warn) 347 (defvar *compile-file-warnings-behaviour* :warn 348 "How should ASDF react if it encounters a warning when compiling a 349 file? Valid values are :error, :warn, and :ignore.") 350 351 (defvar *compile-file-failure-behaviour* #+sbcl :error #-sbcl :warn 352 "How should ASDF react if it encounters a failure \(per the 353 ANSI spec of COMPILE-FILE\) when compiling a file? Valid values are 354 :error, :warn, and :ignore. Note that ASDF ALWAYS raises an error 355 if it fails to create an output file when compiling.") 350 356 351 357 (defvar *verbose-out* nil) … … 366 372 ;;;; ------------------------------------------------------------------------- 367 373 ;;;; ASDF Interface, in terms of generic functions. 368 369 (defgeneric perform-with-restarts (operation component)) 370 (defgeneric perform (operation component)) 371 (defgeneric operation-done-p (operation component)) 372 (defgeneric explain (operation component)) 373 (defgeneric output-files (operation component)) 374 (defgeneric input-files (operation component)) 374 (defmacro defgeneric* (name formals &rest options) 375 `(progn 376 #+(or gcl ecl) (fmakunbound ',name) 377 (defgeneric ,name ,formals ,@options))) 378 379 (defgeneric* perform-with-restarts (operation component)) 380 (defgeneric* perform (operation component)) 381 (defgeneric* operation-done-p (operation component)) 382 (defgeneric* explain (operation component)) 383 (defgeneric* output-files (operation component)) 384 (defgeneric* input-files (operation component)) 375 385 (defgeneric component-operation-time (operation component)) 376 386 377 (defgeneric system-source-file (system)387 (defgeneric* system-source-file (system) 378 388 (:documentation "Return the source file in which system is defined.")) 379 389 … … 397 407 (defgeneric version-satisfies (component version)) 398 408 399 (defgeneric find-component (base path)409 (defgeneric* find-component (base path) 400 410 (:documentation "Finds the component with PATH starting from BASE module; 401 411 if BASE is nil, then the component is assumed to be a system.")) … … 456 466 (defgeneric traverse (operation component) 457 467 (:documentation 458 "Generate and return a plan for performing `operation` on `component`.459 460 The plan returned is a list of dotted-pairs. Each pair is the `cons`461 of ASDF operation object and a `component`object. The pairs will be462 processed in order by `operate`."))468 "Generate and return a plan for performing OPERATION on COMPONENT. 469 470 The plan returned is a list of dotted-pairs. Each pair is the CONS 471 of ASDF operation object and a COMPONENT object. The pairs will be 472 processed in order by OPERATE.")) 463 473 464 474 … … 467 477 468 478 (defmacro while-collecting ((&rest collectors) &body body) 479 "COLLECTORS should be a list of names for collections. A collector 480 defines a function that, when applied to an argument inside BODY, will 481 add its argument to the corresponding collection. Returns multiple values, 482 a list for each collection, in order. 483 E.g., 484 \(while-collecting \(foo bar\) 485 \(dolist \(x '\(\(a 1\) \(b 2\) \(c 3\)\)\) 486 \(foo \(first x\)\) 487 \(bar \(second x\)\)\)\) 488 Returns two values: \(A B C\) and \(1 2 3\)." 469 489 (let ((vars (mapcar #'(lambda (x) (gensym (symbol-name x))) collectors)) 470 490 (initial-values (mapcar (constantly nil) collectors))) … … 480 500 "Returns a new pathname with same HOST, DEVICE, DIRECTORY as PATHNAME, 481 501 and NIL NAME, TYPE and VERSION components" 482 (make-pathname :name nil :type nil :version nil :defaults pathname)) 483 484 (defun current-directory () 485 (truenamize (pathname-directory-pathname *default-pathname-defaults*))) 502 (when pathname 503 (make-pathname :name nil :type nil :version nil :defaults pathname))) 486 504 487 505 (defun merge-pathnames* (specified &optional (defaults *default-pathname-defaults*)) … … 494 512 (defaults (pathname defaults)) 495 513 (directory (pathname-directory specified)) 496 (directory (if (stringp directory) `(:absolute ,directory) directory))514 #-sbcl (directory (if (stringp directory) `(:absolute ,directory) directory)) 497 515 (name (or (pathname-name specified) (pathname-name defaults))) 498 516 (type (or (pathname-type specified) (pathname-type defaults))) … … 517 535 (values (pathname-host defaults) 518 536 (pathname-device defaults) 519 (if ( null (pathname-directory defaults))520 directory521 (append (pathname-directory defaults) (cdr directory)))537 (if (pathname-directory defaults) 538 (append (pathname-directory defaults) (cdr directory)) 539 directory) 522 540 (unspecific-handler defaults))) 523 541 #+gcl … … 539 557 or "or a flag") 540 558 559 (defun first-char (s) 560 (and (stringp s) (plusp (length s)) (char s 0))) 561 562 (defun last-char (s) 563 (and (stringp s) (plusp (length s)) (char s (1- (length s))))) 564 541 565 (defun asdf-message (format-string &rest format-args) 542 566 (declare (dynamic-extent format-args)) … … 544 568 545 569 (defun split-string (string &key max (separator '(#\Space #\Tab))) 546 "Split STRING in components separater by any of the characters in the sequence SEPARATOR,547 return a list.570 "Split STRING into a list of components separated by 571 any of the characters in the sequence SEPARATOR. 548 572 If MAX is specified, then no more than max(1,MAX) components will be returned, 549 573 starting the separation from the end, e.g. when called with arguments … … 596 620 (multiple-value-bind (relative components) 597 621 (if (equal (first components) "") 598 (if ( and (plusp (length s)) (eql (char s 0) #\/))622 (if (equal (first-char s) #\/) 599 623 (values :absolute (cdr components)) 600 624 (values :relative nil)) 601 625 (values :relative components)) 626 (setf components (remove "" components :test #'equal)) 602 627 (cond 603 628 ((equal last-comp "") 604 (values relative (butlast components) nil))629 (values relative components nil)) ; "" already removed 605 630 (force-directory 606 631 (values relative components nil)) … … 618 643 :unless (eq k key) 619 644 :append (list k v))) 620 621 (defun resolve-symlinks (path)622 #-allegro (truenamize path)623 #+allegro (excl:pathname-resolve-symbolic-links path))624 645 625 646 (defun getenv (x) … … 629 650 (sb-ext:posix-getenv x) 630 651 #+clozure 631 (ccl: :getenv x)652 (ccl:getenv x) 632 653 #+clisp 633 654 (ext:getenv x) … … 644 665 645 666 (defun directory-pathname-p (pathname) 646 "Does `pathname`represent a directory?667 "Does PATHNAME represent a directory? 647 668 648 669 A directory-pathname is a pathname _without_ a filename. The three 649 ways that the filename components can be missing are for it to be `nil`,650 `:unspecific`or the empty string.651 652 Note that this does _not_ check to see that `pathname`points to an670 ways that the filename components can be missing are for it to be NIL, 671 :UNSPECIFIC or the empty string. 672 673 Note that this does _not_ check to see that PATHNAME points to an 653 674 actually-existing directory." 654 675 (flet ((check-one (x) … … 734 755 (when (typep p 'logical-pathname) (return p)) 735 756 (ignore-errors (return (truename p))) 736 (when (stringp directory) 737 (return p)) 738 (when (not (eq :absolute (car directory))) 739 (return p)) 757 #-sbcl (when (stringp directory) (return p)) 758 (when (not (eq :absolute (car directory))) (return p)) 740 759 (let ((sofar (ignore-errors (truename (pathname-root p))))) 741 760 (unless sofar (return p)) … … 761 780 (return (solution nil)))))))) 762 781 782 (defun resolve-symlinks (path) 783 #-allegro (truenamize path) 784 #+allegro (excl:pathname-resolve-symbolic-links path)) 785 786 (defun default-directory () 787 (truenamize (pathname-directory-pathname *default-pathname-defaults*))) 788 763 789 (defun lispize-pathname (input-file) 764 790 (make-pathname :type "lisp" :defaults input-file)) 791 792 (defparameter *wild-path* 793 (make-pathname :directory '(:relative :wild-inferiors) 794 :name :wild :type :wild :version :wild)) 795 796 (defun wilden (path) 797 (merge-pathnames* *wild-path* path)) 798 799 (defun directorize-pathname-host-device (pathname) 800 (let* ((root (pathname-root pathname)) 801 (wild-root (wilden root)) 802 (absolute-pathname (merge-pathnames* pathname root)) 803 (foo (make-pathname :directory '(:absolute "FOO") :defaults root)) 804 (separator (last-char (namestring foo))) 805 (root-namestring (namestring root)) 806 (root-string 807 (substitute-if #\/ 808 (lambda (x) (or (eql x #\:) 809 (eql x separator))) 810 root-namestring))) 811 (multiple-value-bind (relative path filename) 812 (component-name-to-pathname-components root-string t) 813 (declare (ignore relative filename)) 814 (let ((new-base 815 (make-pathname :defaults root 816 :directory `(:absolute ,@path)))) 817 (translate-pathname absolute-pathname wild-root (wilden new-base)))))) 765 818 766 819 ;;;; ------------------------------------------------------------------------- … … 775 828 ;; order to fix all conditions that build on it. -- rgr, 28-Jul-02.] 776 829 #+cmu (:report print-object)) 830 831 (declaim (ftype (function (t) t) 832 format-arguments format-control 833 error-name error-pathname error-condition 834 duplicate-names-name 835 error-component error-operation 836 module-components module-components-by-name) 837 (ftype (function (t t) t) (setf module-components-by-name))) 838 777 839 778 840 (define-condition formatted-system-definition-error (system-definition-error) … … 895 957 896 958 (defun compute-module-components-by-name (module) 897 (let ((hash (m odule-components-by-name module)))898 ( clrhashhash)959 (let ((hash (make-hash-table :test 'equal))) 960 (setf (module-components-by-name module) hash) 899 961 (loop :for c :in (module-components module) 900 962 :for name = (component-name c) … … 912 974 :accessor module-components) 913 975 (components-by-name 914 :initform (make-hash-table :test 'equal)915 976 :accessor module-components-by-name) 916 977 ;; What to do if we can't satisfy a dependency of one of this module's … … 940 1001 (merge-pathnames* 941 1002 (component-relative-pathname component) 942 ( component-parent-pathname component))))1003 (pathname-directory-pathname (component-parent-pathname component))))) 943 1004 (unless (or (null pathname) (absolute-pathname-p pathname)) 944 1005 (error "Invalid relative pathname ~S for component ~S" pathname component)) … … 1014 1075 1015 1076 (defun map-systems (fn) 1016 "Apply `fn`to each defined system.1017 1018 `fn`should be a function of one argument. It will be1077 "Apply FN to each defined system. 1078 1079 FN should be a function of one argument. It will be 1019 1080 called with an object of type asdf:system." 1020 1081 (maphash (lambda (_ datum) … … 1029 1090 1030 1091 (defparameter *system-definition-search-functions* 1031 '(sysdef-central-registry-search sysdef-source-registry-search ))1092 '(sysdef-central-registry-search sysdef-source-registry-search sysdef-find-asdf)) 1032 1093 1033 1094 (defun system-definition-pathname (system) … … 1054 1115 Going forward, we recommend new users should be using the source-registry. 1055 1116 ") 1117 1118 (defun probe-asd (name defaults) 1119 (block nil 1120 (when (directory-pathname-p defaults) 1121 (let ((file 1122 (make-pathname 1123 :defaults defaults :version :newest :case :local 1124 :name name 1125 :type "asd"))) 1126 (when (probe-file file) 1127 (return file))) 1128 #+(and (or win32 windows mswindows mingw32) (not cygwin) (not clisp)) 1129 (let ((shortcut 1130 (make-pathname 1131 :defaults defaults :version :newest :case :local 1132 :name (concatenate 'string name ".asd") 1133 :type "lnk"))) 1134 (when (probe-file shortcut) 1135 (let ((target (parse-windows-shortcut shortcut))) 1136 (when target 1137 (return (pathname target))))))))) 1056 1138 1057 1139 (defun sysdef-central-registry-search (system) … … 1073 1155 (message 1074 1156 (format nil 1075 "~@<While searching for system `~a`: `~a`evaluated ~1076 to `~a`which is not a directory.~@:>"1157 "~@<While searching for system ~S: ~S evaluated ~ 1158 to ~S which is not a directory.~@:>" 1077 1159 system dir defaults))) 1078 1160 (error message)) … … 1123 1205 1124 1206 (defun find-system (name &optional (error-p t)) 1125 (let* ((name (coerce-name name)) 1126 (in-memory (system-registered-p name)) 1127 (on-disk (system-definition-pathname name))) 1128 (when (and on-disk 1129 (or (not in-memory) 1130 (< (car in-memory) (safe-file-write-date on-disk)))) 1131 (let ((package (make-temporary-package))) 1132 (unwind-protect 1133 (handler-bind 1134 ((error (lambda (condition) 1135 (error 'load-system-definition-error 1136 :name name :pathname on-disk 1137 :condition condition)))) 1138 (let ((*package* package)) 1139 (asdf-message 1140 "~&~@<; ~@;loading system definition from ~A into ~A~@:>~%" 1141 on-disk *package*) 1142 (load on-disk))) 1143 (delete-package package)))) 1144 (let ((in-memory (system-registered-p name))) 1145 (if in-memory 1146 (progn (when on-disk (setf (car in-memory) 1147 (safe-file-write-date on-disk))) 1148 (cdr in-memory)) 1149 (when error-p (error 'missing-component :requires name)))))) 1207 (catch 'find-system 1208 (let* ((name (coerce-name name)) 1209 (in-memory (system-registered-p name)) 1210 (on-disk (system-definition-pathname name))) 1211 (when (and on-disk 1212 (or (not in-memory) 1213 (< (car in-memory) (safe-file-write-date on-disk)))) 1214 (let ((package (make-temporary-package))) 1215 (unwind-protect 1216 (handler-bind 1217 ((error (lambda (condition) 1218 (error 'load-system-definition-error 1219 :name name :pathname on-disk 1220 :condition condition)))) 1221 (let ((*package* package)) 1222 (asdf-message 1223 "~&~@<; ~@;loading system definition from ~A into ~A~@:>~%" 1224 on-disk *package*) 1225 (load on-disk))) 1226 (delete-package package)))) 1227 (let ((in-memory (system-registered-p name))) 1228 (if in-memory 1229 (progn (when on-disk (setf (car in-memory) 1230 (safe-file-write-date on-disk))) 1231 (cdr in-memory)) 1232 (when error-p (error 'missing-component :requires name))))))) 1150 1233 1151 1234 (defun register-system (name system) … … 1153 1236 (setf (gethash (coerce-name name) *defined-systems*) 1154 1237 (cons (get-universal-time) system))) 1238 1239 (defun sysdef-find-asdf (system) 1240 (let ((name (coerce-name system))) 1241 (when (equal name "asdf") 1242 (let* ((registered (cdr (gethash name *defined-systems*))) 1243 (asdf (or registered 1244 (make-instance 1245 'system :name "asdf" 1246 :source-file (or *compile-file-truename* *load-truename*))))) 1247 (unless registered 1248 (register-system "asdf" asdf)) 1249 (throw 'find-system asdf))))) 1155 1250 1156 1251 … … 1172 1267 1173 1268 (defmethod find-component ((module module) (name string)) 1174 (when (slot-boundp module 'components-by-name) 1175 (values (gethash name (module-components-by-name module))))) 1269 (unless (slot-boundp module 'components-by-name) ;; SBCL may miss the u-i-f-r-c method!!! 1270 (compute-module-components-by-name module)) 1271 (values (gethash name (module-components-by-name module)))) 1176 1272 1177 1273 (defmethod find-component ((component component) (name symbol)) … … 1603 1699 flag)) 1604 1700 1605 (defmethod traverse ((operation operation) (c component))1606 ;; cerror'ing a feature that seems to have NEVER EVER worked1607 ;; ever since danb created it in his 2003-03-16 commit e0d02781.1608 ;; It was both fixed and disabled in the 1.700 rewrite.1609 (when (consp (operation-forced operation))1610 (cerror "Continue nonetheless."1611 "Congratulations, you're the first ever user of the :force (list of system names) feature! Please contact the asdf-devel mailing-list to collect a cookie.")1612 (setf (operation-forced operation)1613 (mapcar #'coerce-name (operation-forced operation))))1614 (flatten-tree1615 (while-collecting (collect)1616 (do-traverse operation c #'collect))))1617 1618 1701 (defun flatten-tree (l) 1619 1702 ;; You collected things into a list. … … 1632 1715 (r* l)))) 1633 1716 1717 (defmethod traverse ((operation operation) (c component)) 1718 ;; cerror'ing a feature that seems to have NEVER EVER worked 1719 ;; ever since danb created it in his 2003-03-16 commit e0d02781. 1720 ;; It was both fixed and disabled in the 1.700 rewrite. 1721 (when (consp (operation-forced operation)) 1722 (cerror "Continue nonetheless." 1723 "Congratulations, you're the first ever user of the :force (list of system names) feature! Please contact the asdf-devel mailing-list to collect a cookie.") 1724 (setf (operation-forced operation) 1725 (mapcar #'coerce-name (operation-forced operation)))) 1726 (flatten-tree 1727 (while-collecting (collect) 1728 (do-traverse operation c #'collect)))) 1729 1634 1730 (defmethod perform ((operation operation) (c source-file)) 1635 1731 (sysdef-error … … 1673 1769 (get-universal-time))) 1674 1770 1771 (declaim (ftype (function ((or pathname string) &rest t &key &allow-other-keys) 1772 (values t t t)) 1773 compile-file*)) 1774 1675 1775 ;;; perform is required to check output-files to find out where to put 1676 1776 ;;; its answers, in case it has been overridden for site policy … … 1678 1778 #-:broken-fasl-loader 1679 1779 (let ((source-file (component-pathname c)) 1680 (output-file (car (output-files operation c)))) 1780 (output-file (car (output-files operation c))) 1781 (*compile-file-warnings-behaviour* (operation-on-warnings operation)) 1782 (*compile-file-failure-behaviour* (operation-on-failure operation))) 1681 1783 (multiple-value-bind (output warnings-p failure-p) 1682 (apply #'compile-file source-file :output-file output-file1784 (apply #'compile-file* source-file :output-file output-file 1683 1785 (compile-op-flags operation)) 1684 1786 (when warnings-p … … 1856 1958 ;;;; Invoking Operations 1857 1959 1858 (defgeneric operate (operation-class system &key &allow-other-keys))1960 (defgeneric* operate (operation-class system &key &allow-other-keys)) 1859 1961 1860 1962 (defmethod operate (operation-class system &rest args … … 1904 2006 "Operate does three things: 1905 2007 1906 1. It creates an instance of `operation-class`using any keyword parameters2008 1. It creates an instance of OPERATION-CLASS using any keyword parameters 1907 2009 as initargs. 1908 2. It finds the asdf-system specified by `system`(possibly loading2010 2. It finds the asdf-system specified by SYSTEM (possibly loading 1909 2011 it from disk). 1910 3. It then calls `traverse`with the operation and system as arguments1911 1912 The traverse operation is wrapped in `with-compilation-unit`and error1913 handling code. If a `version`argument is supplied, then operate also1914 ensures that the system found satisfies it using the `version-satisfies`2012 3. It then calls TRAVERSE with the operation and system as arguments 2013 2014 The traverse operation is wrapped in WITH-COMPILATION-UNIT and error 2015 handling code. If a VERSION argument is supplied, then operate also 2016 ensures that the system found satisfies it using the VERSION-SATISFIES 1915 2017 method. 1916 2018 … … 1950 2052 ;;;; Defsystem 1951 2053 2054 (defun load-pathname () 2055 (let ((pn (or *load-pathname* *compile-file-pathname*))) 2056 (if *resolve-symlinks* 2057 (and pn (resolve-symlinks pn)) 2058 pn))) 2059 1952 2060 (defun determine-system-pathname (pathname pathname-supplied-p) 1953 ;; called from the defsystem macro.1954 ;; the pathname of a system is either2061 ;; The defsystem macro calls us to determine 2062 ;; the pathname of a system as follows: 1955 2063 ;; 1. the one supplied, 1956 ;; 2. derived from the *load-truename* (see below), or 1957 ;; 3. taken from *default-pathname-defaults* 1958 ;; 1959 ;; if using *load-truename*, then we also deal with whether or not 1960 ;; to resolve symbolic links. If not resolving symlinks, then we use 1961 ;; *load-pathname* instead of *load-truename* since in some 1962 ;; implementations, the latter has *already resolved it. 1963 (let ((file-pathname 1964 (when (or *load-pathname* *compile-file-pathname*) 1965 (pathname-directory-pathname 1966 (if *resolve-symlinks* 1967 (resolve-symlinks (or *load-truename* *compile-file-truename*)) 1968 *load-pathname*))))) 1969 (or (and pathname-supplied-p (merge-pathnames* pathname file-pathname)) 2064 ;; 2. derived from *load-pathname* via load-pathname 2065 ;; 3. taken from the *default-pathname-defaults* via default-directory 2066 (let* ((file-pathname (load-pathname)) 2067 (directory-pathname (and file-pathname (pathname-directory-pathname file-pathname)))) 2068 (or (and pathname-supplied-p (merge-pathnames* pathname directory-pathname)) 1970 2069 file-pathname 1971 ( current-directory))))2070 (default-directory)))) 1972 2071 1973 2072 (defmacro defsystem (name &body options) … … 1990 2089 (register-system (quote ,name) 1991 2090 (make-instance ',class :name ',name)))) 1992 (%set-system-source-file *load-truename*2091 (%set-system-source-file (load-pathname) 1993 2092 (cdr (system-registered-p ',name)))) 1994 2093 (parse-component-form … … 1999 2098 ',component-options)))))) 2000 2099 2001 2002 2100 (defun class-for-type (parent type) 2003 (let* ((extra-symbols (list (find-symbol (symbol-name type) *package*) 2004 (find-symbol (symbol-name type) 2005 (load-time-value 2006 (package-name :asdf))))) 2007 (class (dolist (symbol (if (keywordp type) 2008 extra-symbols 2009 (cons type extra-symbols))) 2010 (when (and symbol 2011 (find-class symbol nil) 2012 (subtypep symbol 'component)) 2013 (return (find-class symbol)))))) 2014 (or class 2015 (and (eq type :file) 2016 (or (module-default-component-class parent) 2017 (find-class 'cl-source-file))) 2018 (sysdef-error "~@<don't recognize component type ~A~@:>" type)))) 2101 (or (loop :for symbol :in (list 2102 (unless (keywordp type) type) 2103 (find-symbol (symbol-name type) *package*) 2104 (find-symbol (symbol-name type) :asdf)) 2105 :for class = (and symbol (find-class symbol nil)) 2106 :when (and class (subtypep class 'component)) 2107 :return class) 2108 (and (eq type :file) 2109 (or (module-default-component-class parent) 2110 (find-class *default-component-class*))) 2111 (sysdef-error "~@<don't recognize component type ~A~@:>" type))) 2019 2112 2020 2113 (defun maybe-add-tree (tree op1 op2 c) … … 2179 2272 2180 2273 (defun run-shell-command (control-string &rest args) 2181 "Interpolate `args` into `control-string` as if by `format`, and2274 "Interpolate ARGS into CONTROL-STRING as if by FORMAT, and 2182 2275 synchronously execute the result using a Bourne-compatible shell, with 2183 output to `*verbose-out*`. Returns the shell's exit code."2276 output to *VERBOSE-OUT*. Returns the shell's exit code." 2184 2277 (let ((command (apply #'format nil control-string args))) 2185 2278 (asdf-message "; $ ~A~%" command) … … 2334 2427 ;; #+sbcl (format nil "~a-fasl~d" s sb-fasl:+fasl-file-version+) ; fasl-f-v is redundant 2335 2428 #+armedbear (format nil "~a-fasl~a" s system::*fasl-version*) 2336 #+(or mcl sbcl scl) s2429 #+(or cormanlisp mcl sbcl scl) s 2337 2430 #-(or allegro armedbear clisp clozure cmu cormanlisp digitool 2338 2431 ecl gcl lispworks mcl sbcl scl) s)) … … 2454 2547 (funcall validator (car forms)))) 2455 2548 2549 (defun hidden-file-p (pathname) 2550 (equal (first-char (pathname-name pathname)) #\.)) 2551 2456 2552 (defun validate-configuration-directory (directory tag validator) 2457 2553 (let ((files (sort (ignore-errors 2458 (directory (make-pathname :name :wild :type :wild :defaults directory) 2459 #+sbcl :resolve-symlinks #+sbcl nil)) 2554 (remove-if 2555 'hidden-file-p 2556 (directory (make-pathname :name :wild :type "conf" :defaults directory) 2557 #+sbcl :resolve-symlinks #+sbcl nil))) 2460 2558 #'string< :key #'namestring))) 2461 2559 `(,tag … … 2514 2612 (values)) 2515 2613 2516 (defparameter *wild-path*2517 (make-pathname :directory '(:relative :wild-inferiors)2518 :name :wild :type :wild :version :wild))2519 2520 2614 (defparameter *wild-asd* 2521 2615 (make-pathname :directory '(:relative :wild-inferiors) 2522 2616 :name :wild :type "asd" :version :newest)) 2523 2617 2524 (defun wilden (path) 2525 (merge-pathnames* *wild-path* path)) 2618 2619 (declaim (ftype (function (t &optional boolean) (or null pathname)) 2620 resolve-location)) 2621 2622 (defun resolve-relative-location-component (super x &optional wildenp) 2623 (let* ((r (etypecase x 2624 (pathname x) 2625 (string x) 2626 (cons 2627 (let ((car (resolve-relative-location-component super (car x) nil))) 2628 (if (null (cdr x)) 2629 car 2630 (let ((cdr (resolve-relative-location-component 2631 (merge-pathnames* car super) (cdr x) wildenp))) 2632 (merge-pathnames* cdr car))))) 2633 ((eql :default-directory) 2634 (relativize-pathname-directory (default-directory))) 2635 ((eql :implementation) (implementation-identifier)) 2636 ((eql :implementation-type) (string-downcase (implementation-type))) 2637 #-(and (or win32 windows mswindows mingw32) (not cygwin)) 2638 ((eql :uid) (princ-to-string (get-uid))))) 2639 (d (if (pathnamep x) r (ensure-directory-pathname r))) 2640 (s (if (and wildenp (not (pathnamep x))) 2641 (wilden d) 2642 d))) 2643 (when (and (absolute-pathname-p s) (not (pathname-match-p s (wilden super)))) 2644 (error "pathname ~S is not relative to ~S" s super)) 2645 (merge-pathnames* s super))) 2526 2646 2527 2647 (defun resolve-absolute-location-component (x wildenp) … … 2545 2665 ((eql :user-cache) (resolve-location *user-cache* nil)) 2546 2666 ((eql :system-cache) (resolve-location *system-cache* nil)) 2547 ((eql : current-directory) (current-directory))))2667 ((eql :default-directory) (default-directory)))) 2548 2668 (s (if (and wildenp (not (pathnamep x))) 2549 2669 (wilden r) … … 2552 2672 (error "Not an absolute pathname ~S" s)) 2553 2673 s)) 2554 2555 (defun resolve-relative-location-component (super x &optional wildenp)2556 (let* ((r (etypecase x2557 (pathname x)2558 (string x)2559 (cons2560 (let ((car (resolve-relative-location-component super (car x) nil)))2561 (if (null (cdr x))2562 car2563 (let ((cdr (resolve-relative-location-component2564 (merge-pathnames* car super) (cdr x) wildenp)))2565 (merge-pathnames* cdr car)))))2566 ((eql :current-directory)2567 (relativize-pathname-directory (current-directory)))2568 ((eql :implementation) (implementation-identifier))2569 ((eql :implementation-type) (string-downcase (implementation-type)))2570 ((eql :uid) (princ-to-string (get-uid)))))2571 (d (if (pathnamep x) r (ensure-directory-pathname r)))2572 (s (if (and wildenp (not (pathnamep x)))2573 (wilden d)2574 d)))2575 (when (and (absolute-pathname-p s) (not (pathname-match-p s (wilden super))))2576 (error "pathname ~S is not relative to ~S" s super))2577 (merge-pathnames* s super)))2578 2674 2579 2675 (defun resolve-location (x &optional wildenp) … … 2682 2778 ;; so we must disable translations for implementation paths. 2683 2779 #+sbcl (,(getenv "SBCL_HOME") ()) 2684 #+ecl (,(translate-logical-pathname "SYS:**;*.*") ()) ; only needed if LPNs are resolved manually.2685 #+clozure (,(wilden ( ccl::ccl-directory)) ()) ; not needed: no precompiled ASDF system2780 #+ecl (,(translate-logical-pathname "SYS:**;*.*") ()) ; not needed: no precompiled ASDF system 2781 #+clozure (,(wilden (truename #p"ccl:")) ()) ; not needed: no precompiled ASDF system 2686 2782 ;; All-import, here is where we want user stuff to be: 2687 2783 :inherit-configuration … … 2707 2803 2708 2804 (defgeneric process-output-translations (spec &key inherit collect)) 2805 (declaim (ftype (function (t &key (:collect (or symbol function))) t) 2806 inherit-output-translations)) 2807 (declaim (ftype (function (t &key (:collect (or symbol function)) (:inherit list)) t) 2808 process-output-translations-directive)) 2809 2709 2810 (defmethod process-output-translations ((x symbol) &key 2710 2811 (inherit *default-output-translations*) … … 2834 2935 :finally (return p))))) 2835 2936 2836 (defun last-char (s)2837 (and (stringp s) (plusp (length s)) (char s (1- (length s)))))2838 2839 (defun directorize-pathname-host-device (pathname)2840 (let* ((root (pathname-root pathname))2841 (wild-root (wilden root))2842 (absolute-pathname (merge-pathnames* pathname root))2843 (foo (make-pathname :directory '(:absolute "FOO") :defaults root))2844 (separator (last-char (namestring foo)))2845 (root-namestring (namestring root))2846 (root-string2847 (substitute-if #\/2848 (lambda (x) (or (eql x #\:)2849 (eql x separator)))2850 root-namestring)))2851 (multiple-value-bind (relative path filename)2852 (component-name-to-pathname-components root-string t)2853 (declare (ignore relative filename))2854 (let ((new-base2855 (make-pathname :defaults root2856 :directory `(:absolute ,@path))))2857 (translate-pathname absolute-pathname wild-root (wilden new-base))))))2858 2859 2937 (defmethod output-files :around (operation component) 2860 2938 "Translate output files, unless asked not to" … … 2867 2945 t)) 2868 2946 2869 (defun compile-file-pathname* (input-file &rest keys) 2870 (apply-output-translations 2871 (apply #'compile-file-pathname 2872 (truenamize (lispize-pathname input-file)) 2873 keys))) 2947 (defun compile-file-pathname* (input-file &rest keys &key output-file &allow-other-keys) 2948 (or output-file 2949 (apply-output-translations 2950 (apply 'compile-file-pathname 2951 (truenamize (lispize-pathname input-file)) 2952 keys)))) 2953 2954 (defun tmpize-pathname (x) 2955 (make-pathname 2956 :name (format nil "ASDF-TMP-~A" (pathname-name x)) 2957 :defaults x)) 2958 2959 (defun delete-file-if-exists (x) 2960 (when (probe-file x) 2961 (delete-file x))) 2962 2963 (defun compile-file* (input-file &rest keys &key &allow-other-keys) 2964 (let* ((output-file (apply 'compile-file-pathname* input-file keys)) 2965 (tmp-file (tmpize-pathname output-file)) 2966 (status :error)) 2967 (multiple-value-bind (output-truename warnings-p failure-p) 2968 (apply 'compile-file input-file :output-file tmp-file keys) 2969 (cond 2970 (failure-p 2971 (setf status *compile-file-failure-behaviour*)) 2972 (warnings-p 2973 (setf status *compile-file-warnings-behaviour*)) 2974 (t 2975 (setf status :success))) 2976 (ecase status 2977 ((:success :warn :ignore) 2978 (delete-file-if-exists output-file) 2979 (when output-truename 2980 (rename-file output-truename output-file) 2981 (setf output-truename output-file))) 2982 (:error 2983 (delete-file-if-exists output-truename) 2984 (setf output-truename nil))) 2985 (values output-truename warnings-p failure-p)))) 2874 2986 2875 2987 #+abcl … … 2999 3111 3000 3112 ;; Using ack 1.2 exclusions 3001 (defvar *default- exclusions*3113 (defvar *default-source-registry-exclusions* 3002 3114 '(".bzr" ".cdv" "~.dep" "~.dot" "~.nib" "~.plst" 3003 3115 ".git" ".hg" ".pc" ".svn" "CVS" "RCS" "SCCS" "_darcs" 3004 3116 "_sgbak" "autom4te.cache" "cover_db" "_build")) 3117 3118 (defvar *source-registry-exclusions* *default-source-registry-exclusions*) 3005 3119 3006 3120 (defvar *source-registry* () … … 3024 3138 (setf *source-registry* '()) 3025 3139 (values)) 3026 3027 (defun probe-asd (name defaults)3028 (block nil3029 (when (directory-pathname-p defaults)3030 (let ((file3031 (make-pathname3032 :defaults defaults :version :newest :case :local3033 :name name3034 :type "asd")))3035 (when (probe-file file)3036 (return file)))3037 #+(and (or win32 windows mswindows mingw32) (not cygwin) (not clisp))3038 (let ((shortcut3039 (make-pathname3040 :defaults defaults :version :newest :case :local3041 :name (concatenate 'string name ".asd")3042 :type "lnk")))3043 (when (probe-file shortcut)3044 (let ((target (parse-windows-shortcut shortcut)))3045 (when target3046 (return (pathname target)))))))))3047 3048 (defun sysdef-source-registry-search (system)3049 (ensure-source-registry)3050 (loop :with name = (coerce-name system)3051 :for defaults :in (source-registry)3052 :for file = (probe-asd name defaults)3053 :when file :return file))3054 3140 3055 3141 (defun validate-source-registry-directive (directive) … … 3061 3147 (and (length=n-p rest 1) 3062 3148 (typep (car rest) '(or pathname string null)))) 3063 ((:exclude )3149 ((:exclude :also-exclude) 3064 3150 (every #'stringp rest)) 3065 3151 (null rest)))) … … 3147 3233 `(:source-registry 3148 3234 #+sbcl (:tree ,(getenv "SBCL_HOME")) 3149 :inherit-configuration)) 3235 :inherit-configuration 3236 #+cmu (:tree #p"modules:"))) 3150 3237 (defun default-source-registry () 3151 3238 (flet ((try (x sub) (try-directory-subpath x sub :type :directory))) … … 3186 3273 3187 3274 (defgeneric process-source-registry (spec &key inherit register)) 3275 (declaim (ftype (function (t &key (:register (or symbol function))) t) 3276 inherit-source-registry)) 3277 (declaim (ftype (function (t &key (:register (or symbol function)) (:inherit list)) t) 3278 process-source-registry-directive)) 3279 3188 3280 (defmethod process-source-registry ((x symbol) &key inherit register) 3189 3281 (process-source-registry (funcall x) :inherit inherit :register register)) … … 3205 3297 (inherit-source-registry inherit :register register)) 3206 3298 (defmethod process-source-registry ((form cons) &key inherit register) 3207 (let ((* default-exclusions* *default-exclusions*))3299 (let ((*source-registry-exclusions* *default-source-registry-exclusions*)) 3208 3300 (dolist (directive (cdr (validate-source-registry-form form))) 3209 3301 (process-source-registry-directive directive :inherit inherit :register register)))) … … 3226 3318 (destructuring-bind (pathname) rest 3227 3319 (when pathname 3228 (funcall register (ensure-directory-pathname pathname) :recurse t :exclude * default-exclusions*))))3320 (funcall register (ensure-directory-pathname pathname) :recurse t :exclude *source-registry-exclusions*)))) 3229 3321 ((:exclude) 3230 (setf *default-exclusions* rest)) 3322 (setf *source-registry-exclusions* rest)) 3323 ((:also-exclude) 3324 (appendf *source-registry-exclusions* rest)) 3231 3325 ((:default-registry) 3232 3326 (inherit-source-registry '(default-source-registry) :register register)) … … 3234 3328 (inherit-source-registry inherit :register register)) 3235 3329 ((:ignore-inherited-configuration) 3236 nil)))) 3330 nil))) 3331 nil) 3237 3332 3238 3333 (defun flatten-source-registry (&optional parameter) … … 3269 3364 (initialize-source-registry))) 3270 3365 3366 (defun sysdef-source-registry-search (system) 3367 (ensure-source-registry) 3368 (loop :with name = (coerce-name system) 3369 :for defaults :in (source-registry) 3370 :for file = (probe-asd name defaults) 3371 :when file :return file)) 3372 3271 3373 ;;;; ----------------------------------------------------------------- 3272 3374 ;;;; Hook into REQUIRE for ABCL, ClozureCL, CMUCL, ECL and SBCL … … 3279 3381 (missing-component (constantly nil)) 3280 3382 (error (lambda (e) 3281 (format *error-output* "ASDF could not load ~ Abecause ~A.~%"3383 (format *error-output* "ASDF could not load ~(~A~) because ~A.~%" 3282 3384 name e)))) 3283 3385 (let* ((*verbose-out* (make-broadcast-stream)) 3284 (system (find-system namenil)))3386 (system (find-system (string-downcase name) nil))) 3285 3387 (when system 3286 (load-system name)3388 (load-system system) 3287 3389 t)))) 3288 3390 (pushnew 'module-provide-asdf 3289 3391 #+abcl sys::*module-provider-functions* 3290 #+clozure ccl: :*module-provider-functions*3392 #+clozure ccl:*module-provider-functions* 3291 3393 #+cmu ext:*module-provider-functions* 3292 3394 #+ecl si:*module-provider-functions* … … 3313 3415 ;;;; Done! 3314 3416 (when *load-verbose* 3315 (asdf-message ";; ASDF, version ~a " (asdf-version)))3417 (asdf-message ";; ASDF, version ~a~%" (asdf-version))) 3316 3418 3317 3419 #+allegro … … 3321 3423 3322 3424 (pushnew :asdf *features*) 3323 ;; this is a release candidate for ASDF 2.03324 3425 (pushnew :asdf2 *features*) 3325 3426
Note: See TracChangeset
for help on using the changeset viewer.