Commit b8f0d69d authored by Francois-Rene Rideau's avatar Francois-Rene Rideau
Browse files

1.721: integrate feedback from rtoym, p_l.

* for configuration directories, only match files in .conf
 that are not unix hidden files. This notably takes care of backups.
 (Solves issue found by p_l.)

* Before calling the provide hook, CMUCL normalizes its argument to a string
 (as allowed per CLHS), which means symbols become uppercase strings
 before they reach ASDF that would downcase symbols. I've decided to always
 downcase the argument provided to this hook. (Solves issue raised by rtoym.)
 Note that are hook itself doesn't (PROVIDE ...) anything
 to be pushed onto *MODULES*. Maybe we should:
 (a) only try find-system when (equal (string arg) (string-upcase arg))
 (b) always string-downcase when calling find-system and
 (c) string-upcase again and provide.
 Not done in this commit, though.

* Add #+cmu (:tree #p"modules:") to the wrapping-source-registry. (rtoym)
parent 8b6734db
......@@ -7,10 +7,10 @@ clnet_home := "/project/asdf/public_html/"
sourceDirectory := $(shell pwd)
lisps ?= allegro ccl clisp ecl lispworks sbcl
## untested by me: abcl allegromodern cmucl
lisps ?= allegro ccl clisp ecl sbcl
## not tested by me: abcl allegromodern cmucl lisworks
## FAIL: gclcvs
## maybe supported by asdf, never supported by our tests: cormancl mcl scl
## maybe supported by asdf, not supported yet by our tests: cormancl mcl scl
lisp ?= sbcl
......
......@@ -70,7 +70,7 @@
:test 'equalp :key 'car))
(let* ((asdf-version
;; the 1+ helps the version bumping script discriminate
(subseq "VERSION:1.720" (1+ (length "VERSION"))))
(subseq "VERSION:1.721" (1+ (length "VERSION"))))
(existing-asdf (find-package :asdf))
(vername '#:*asdf-version*)
(versym (and existing-asdf
......@@ -593,7 +593,7 @@ pathnames."
(last-comp (car (last components))))
(multiple-value-bind (relative components)
(if (equal (first components) "")
(if (and (plusp (length s)) (eql (char s 0) #\/))
(if (equal (first-char s) #\/)
(values :absolute (cdr components))
(values :relative nil))
(values :relative components))
......@@ -2446,10 +2446,15 @@ located."
(error "One and only one form allowed for ~A. Got: ~S~%" description forms))
(funcall validator (car forms))))
(defun hidden-file-p (pathname)
(equal (first-char (pathname-name pathname)) #\.))
(defun validate-configuration-directory (directory tag validator)
(let ((files (sort (ignore-errors
(directory (make-pathname :name :wild :type :wild :defaults directory)
#+sbcl :resolve-symlinks #+sbcl nil))
(remove-if
'hidden-file-p
(directory (make-pathname :name :wild :type "conf" :defaults directory)
#+sbcl :resolve-symlinks #+sbcl nil)))
#'string< :key #'namestring)))
`(,tag
,@(loop :for file :in files :append
......@@ -2827,6 +2832,9 @@ effectively disabling the output translation facility."
(translate-pathname p absolute-source destination)))
:finally (return p)))))
(defun first-char (s)
(and (stringp s) (plusp (length s)) (char s 0)))
(defun last-char (s)
(and (stringp s) (plusp (length s)) (char s (1- (length s)))))
......@@ -3139,6 +3147,7 @@ with a different configuration, so the configuration would be re-read then."
(defun wrapping-source-registry ()
`(:source-registry
#+cmu (:tree #p"modules:")
#+sbcl (:tree ,(getenv "SBCL_HOME"))
:inherit-configuration))
(defun default-source-registry ()
......@@ -3272,12 +3281,12 @@ with a different configuration, so the configuration would be re-read then."
((style-warning #'muffle-warning)
(missing-component (constantly nil))
(error (lambda (e)
(format *error-output* "ASDF could not load ~A because ~A.~%"
(format *error-output* "ASDF could not load ~(~A~) because ~A.~%"
name e))))
(let* ((*verbose-out* (make-broadcast-stream))
(system (find-system name nil)))
(system (find-system (string-downcase name) nil)))
(when system
(load-system name)
(load-system system)
t))))
(pushnew 'module-provide-asdf
#+abcl sys::*module-provider-functions*
......
......@@ -343,7 +343,7 @@ The simplest way to add a path to your search path,
say @file{/foo/bar/baz/quux/}
is to create the directory
@file{~/.config/common-lisp/source-registry.conf.d/}
and there create a file with any name of your choice,
and there create a file with any name of your choice but the type @file{conf},
for instance @file{42-bazquux.conf}
containing the line:
......@@ -357,10 +357,11 @@ to be recursively scanned for @file{.asd} files, instead use:
Note that your Operating System distribution or your system administrator
may already have configured system-managed libraries for you.
Also note that when choosing a filename, the convention is to use
the @file{.conf} extension
(and a non-empty extension is required for CLISP compatibility),
and it is customary to start the filename with two digits
The required @file{.conf} extension allows you to have disabled files
or editor backups (ending in @file{~}), and works portably
(for instance, it is a pain to allow both empty and non-empty extension on CLISP).
Excluded are files the name of which start with a @file{.} character.
It is customary to start the filename with two digits
that specify the order in which the directories will be scanned.
ASDF will automatically read your configuration
......@@ -485,7 +486,7 @@ say from @file{/foo/bar/baz/quux/}
to @file{/where/i/want/my/fasls/}
is to create the directory
@file{~/.config/common-lisp/asdf-output-translations.conf.d/}
and there create a file with any name of your choice,
and there create a file with any name of your choice and the type @file{conf},
for instance @file{42-bazquux.conf}
containing the line:
......@@ -510,11 +511,11 @@ In absence of any configuration, the default is to redirect everything
under an implementation-dependent subdirectory of @file{~/.cache/common-lisp/}.
@xref{Controlling where ASDF searches for systems}, for full details.
Also note that when choosing a filename, the convention is to use
the @file{.conf} extension
(and a non-empty extension is required for CLISP compatibility),
and it is customary to start the filename with two digits
The required @file{.conf} extension allows you to have disabled files
or editor backups (ending in @file{~}), and works portably
(for instance, it is a pain to allow both empty and non-empty extension on CLISP).
Excluded are files the name of which start with a @file{.} character.
It is customary to start the filename with two digits
that specify the order in which the directories will be scanned.
ASDF will automatically read your configuration
......
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