Commit 86b7de25 authored by Francois-Rene Rideau's avatar Francois-Rene Rideau

2.016.2: Enhancements for MCL pathname and logical-pathname users.

Major change for RMCL: location strings are now POSIX namestrings.
Major change for logical pathnames: they are now preserved by source-registry;
the price is that only logical pathnames for which merging the name and type
commutes with truename will be found by directory-files and subdirectories.
Minor change for GCL: dropped kluges for 2.6, which never was working.
Simplifications in internals of (implementation-identifier).
Removed *system-cache* and get-uid, which never were working right
(bad attempts at allowing common-lisp-controller compatibility,
but it only ever was but a giant gaping security hole in the waiting).
Simplified resolve-relative-location-component
(ugly because it was written before MERGE-PATHNAMES*).
Updated documentation about the file location DSL.
parent 9ece06df
......@@ -12,7 +12,7 @@
:licence "MIT"
:description "Another System Definition Facility"
:long-description "ASDF builds Common Lisp software organized into defined systems."
:version "2.016.1" ;; to be automatically updated by bin/bump-revision
:version "2.016.2" ;; to be automatically updated by bin/bump-revision
:depends-on ()
:components
((:file "asdf")
......
This diff is collapsed.
......@@ -1937,9 +1937,9 @@ DIRECTIVE :=
(:tree DIRECTORY-PATHNAME-DESIGNATOR) |
;; override the defaults for exclusion patterns
(:exclude PATTERN ...) |
(:exclude EXCLUSION-PATTERN ...) |
;; augment the defaults for exclusion patterns
(:also-exclude PATTERN ...) |
(:also-exclude EXCLUSION-PATTERN ...) |
;; Note that the scope of a an exclude pattern specification is
;; the rest of the current configuration expression or file.
......@@ -1953,35 +1953,47 @@ REGULAR-FILE-PATHNAME-DESIGNATOR := PATHNAME-DESIGNATOR ;; interpreted as a file
DIRECTORY-PATHNAME-DESIGNATOR := PATHNAME-DESIGNATOR ;; interpreted as a directory name
PATHNAME-DESIGNATOR :=
NULL | ;; Special: skip this entry.
ABSOLUTE-COMPONENT-DESIGNATOR |
(ABSOLUTE-COMPONENT-DESIGNATOR RELATIVE-COMPONENT-DESIGNATOR ...)
NIL | ;; Special: skip this entry.
ABSOLUTE-COMPONENT-DESIGNATOR ;; see pathname DSL
EXCLUSION-PATTERN := a string without wildcards, that will be matched exactly
against the name of a any subdirectory in the directory component
of a path. e.g. @code{"_darcs"} will match @file{#p"/foo/bar/_darcs/src/bar.asd"}
@end example
Pathnames are designated using another DSL,
shared with the output-translations configuration DSL below.
@example
ABSOLUTE-COMPONENT-DESIGNATOR :=
(ABSOLUTE-COMPONENT-DESIGNATOR RELATIVE-COMPONENT-DESIGNATOR ...) |
STRING | ;; namestring (better be absolute or bust, directory assumed where applicable)
;; on MCL, a MacOSX-style POSIX namestring (for MacOS9 style, use #p"...")
;; in output-translations, directory is assumed and **/*.*.* added if it's last
PATHNAME | ;; pathname (better be an absolute path, or bust)
:HOME | ;; designates the user-homedir-pathname ~/
:USER-CACHE | ;; designates the default location for the user cache
:SYSTEM-CACHE | ;; designates the default location for the system cache
:HERE ;; designates the location of the configuration file
;; (or *default-pathname-defaults*, if invoked interactively)
:HERE | ;; designates the location of the configuration file
;; (or *default-pathname-defaults*, if invoked interactively)
:ROOT ;; magic, for output-translations source only: paths that are relative to the root of the source host and device
;; Not valid anymore: :SYSTEM-CACHE (was a security hazard)
RELATIVE-COMPONENT-DESIGNATOR :=
STRING | ;; namestring (directory assumed where applicable)
PATHNAME | ;; pathname
:IMPLEMENTATION | ;; a directory based on implementation, e.g. sbcl-1.0.45-linux-amd64
(RELATIVE-COMPONENT-DESIGNATOR RELATIVE-COMPONENT-DESIGNATOR ...) |
STRING | ;; relative directory pathname as interpreted by coerce-pathname
;; in output translations, if last component, **/*.*.* is added
PATHNAME | ;; pathname; unless last component, directory is assumed.
:IMPLEMENTATION | ;; a directory based on implementation, e.g. sbcl-1.0.49-linux-x64
:IMPLEMENTATION-TYPE | ;; a directory based on lisp-implementation-type only, e.g. sbcl
:UID | ;; current UID -- not available on Windows
:USER ;; current USER name -- NOT IMPLEMENTED(!)
PATTERN := a string without wildcards, that will be matched exactly
against the name of a any subdirectory in the directory component
of a path. e.g. @code{"_darcs"} will match @file{#p"/foo/bar/_darcs/src/bar.asd"}
:DEFAULT-DIRECTORY | ;; a relativized version of the default directory
:*/ | ;; any direct subdirectory (since ASDF 2.011.4)
:**/ | ;; any recursively inferior subdirectory (since ASDF 2.011.4)
:*.*.* | ;; any file (since ASDF 2.011.4)
;; Not supported (anymore): :UID and :USERNAME
@end example
For instance, as a simple case, my @file{~/.config/common-lisp/source-registry.conf},
which is the default place ASDF looks for this configuration,
once contained:
which is the default place ASDF looks for this configuration, once contained:
@example
(:source-registry
(:tree (:home "cl")) ;; will expand to e.g. "/home/joeluser/cl/"
......@@ -2453,29 +2465,9 @@ DIRECTIVE :=
(DIRECTORY-DESIGNATOR (:function TRANSLATION-FUNCTION))
DIRECTORY-DESIGNATOR :=
NIL | ;; As source: skip this entry. As destination: same as source
T | ;; as source matches anything, as destination leaves pathname unmapped.
ABSOLUTE-COMPONENT-DESIGNATOR |
(ABSOLUTE-COMPONENT-DESIGNATOR RELATIVE-COMPONENT-DESIGNATOR ...)
ABSOLUTE-COMPONENT-DESIGNATOR :=
NULL | ;; As source: skip this entry. As destination: same as source
:ROOT | ;; magic: paths that are relative to the root of the source host and device
STRING | ;; namestring (directory is assumed, better be absolute or bust, ``/**/*.*'' added)
PATHNAME | ;; pathname (better be an absolute directory or bust)
:HOME | ;; designates the user-homedir-pathname ~/
:USER-CACHE | ;; designates the default location for the user cache
:SYSTEM-CACHE ;; designates the default location for the system cache
RELATIVE-COMPONENT-DESIGNATOR :=
STRING | ;; namestring, directory is assumed. If the last component, /**/*.* is added
PATHNAME | ;; pathname; unless last component, directory is assumed.
:IMPLEMENTATION | ;; a directory based on implementation, e.g. sbcl-1.0.45-linux-amd64
:IMPLEMENTATION-TYPE | ;; a directory based on lisp-implementation-type only, e.g. sbcl
:*/ | ;; any direct subdirectory (since ASDF 2.011.4)
:**/ | ;; any recursively inferior subdirectory (since ASDF 2.011.4)
:*.*.* | ;; any file (since ASDF 2.011.4)
:UID | ;; current UID -- not available on Windows
:USER ;; current USER name -- NOT IMPLEMENTED(!)
ABSOLUTE-COMPONENT-DESIGNATOR ;; same as in the source-registry language
TRANSLATION-FUNCTION :=
SYMBOL | ;; symbol of a function that takes two arguments,
......
......@@ -289,14 +289,19 @@
#+gcl (format t "~&~A~&" (progn (defvar *x* -1) (incf *x*)))
(progn ; 1- we're testing with unix, are we not?
(assert (equal (asdf::resolve-location '(:home)) (truename (user-homedir-pathname))))
(assert (equal (asdf::resolve-location '("/foo" "bar" "baz")) #p"/foo/bar/baz"))
(assert (equal (asdf::resolve-location '("/foo" "bar" "baz") :directory t) #p"/foo/bar/baz/"))
(assert (equal (asdf::resolve-location '("/foo" "bar" "baz") :directory t :wilden t) (asdf::wilden #p"/foo/bar/baz/")))
(assert (equal (asdf::resolve-location '("/foo" "bar" "baz") :directory nil :wilden t) (asdf::wilden #p"/foo/bar/")))
#-gcl
(assert (equal (asdf::resolve-location '("/foo" "bar" #p"**/" "baz" #p"*.*") :directory nil :wilden t) #p"/foo/bar/**/baz/*.*")))
(flet ((same (s1 s2 p1 p2)
(unless (equal (namestring p1) (namestring p2))
(describe p1) (describe p2)
(error "Not the same: ~S vs ~S" s1 s2))))
(macrolet ((x (s1 s2) `(same ',s1 ',s2 ,s1 ,s2)))
;; we're testing with unix, are we not?
(x (asdf::resolve-location '(:home)) (truename (user-homedir-pathname)))
(x (asdf::resolve-location '("/foo" "bar" "baz")) #p"/foo/bar/baz")
(x (asdf::resolve-location '("/foo" "bar" "baz") :directory t) #p"/foo/bar/baz/")
(x (asdf::resolve-location '("/foo" "bar" "baz") :directory t :wilden t) (asdf::wilden #p"/foo/bar/baz/"))
(x (asdf::resolve-location '("/foo" "bar" "baz") :directory nil :wilden t) (asdf::wilden #p"/foo/bar/"))
#-gcl
(x (asdf::resolve-location '("/foo" "bar" :**/ "baz" #p"*.*") :directory nil :wilden t) #p"/foo/bar/**/baz/*.*")))
(or (test-component-pathnames :delete-host t :support-string-pathnames nil)
(leave-lisp "test failed" 1)))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment