[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Bug#560781: [asdf-devel] Bug#560781: (require :package) no longer works for CLC-managed packages

On 2010/01/25, at 15:46 , Far? wrote:

> OK, the ASDF my repo now supports source-registry.conf.d as well as
> source-registry.conf. I'll commit it upstream by next week unless I
> get negative feedback, and hopefully after including some tests.
> Note that at least clisp seems confused when matching *.* or
> (make-pathname :type :wild :name :wild) by refusing to match names
> without a dot in them, which is unfortunate. So it's better to have a
> name in .conf or some such under that directory.

Or perhaps we could consider it conformant, and add the required  
logical host translations for dotless files?

I use the following function to build my translations.  Notice that  
what I'd expect is in the "other" branch, but unfortunately, even the  
_order_ matters for some implementations to correctly translate.

(defun make-translations (host logical-dir physical-dir &optional file- 
    (lambda (item)
      (destructuring-bind (logical-tail physical-tail) item
        (list (apply (function make-pathname)
                     :host host
                     :directory `(:absolute , at logical-dir :wild- 
              (format nil "~A**/~A" physical-dir physical-tail))))

    (if file-type
        `(((:name :wild :type ,file-type :version nil) ,(format nil  
"*.~(~A~)" file-type)))
        '(((:name :wild :type :wild :version nil)   "*.*")
          ((:name :wild :type nil   :version nil)   "*")))
    (if file-type
        `(((:name :wild :type ,file-type :version :wild) ,(format nil  
"*.~(~A~)" file-type)))
        '(((:name :wild :type :wild :version :wild) "*.*")))
    (if file-type
        `(((:name :wild :type ,file-type :version nil) ,(format nil  
"*.~(~A~)" file-type)))
        '(((:name :wild :type nil   :version nil)   "*")
          ((:name :wild :type :wild :version nil) "*.*")))
    #-(OR CLISP sbcl)
    (if file-type
        `(((:name :wild :type ,file-type :version nil)   ,(format nil  
"*.~(~A~)" file-type))
          ((:name :wild :type ,file-type :version :wild) ,(format nil  
"*.~(~A~)" file-type)))
        '(((:name :wild :type nil   :version nil)   "*")
          ((:name :wild :type :wild :version nil)   "*.*")
          ((:name :wild :type :wild :version :wild) "*.*")))))

;; Notice that clhs logical-pathname-translations says that:
;; "From-wildcard is a logical pathname whose host is host."
;; Therefore the host must already exist,
;; so we must first create it by setting its translations to NIL.
(setf (logical-pathname-translations "EXAMPLE") nil)
(setf (logical-pathname-translations "EXAMPLE")
        (make-translations "EXAMPLE" '("PGM") "/bin/example/" "BIN")
        (make-translations "EXAMPLE" '("PGM") "/pgm/example/")
        (make-translations "EXAMPLE" '()      "/example/")))
((#P"EXAMPLE:PGM;**;*.BIN" "/bin/example/**/*.bin")
  (#P"EXAMPLE:PGM;**;*.*"   "/pgm/example/**/*.*")
  (#P"EXAMPLE:PGM;**;*"     "/pgm/example/**/*")
  (#P"EXAMPLE:**;*.*"       "/example/**/*.*")
  (#P"EXAMPLE:**;*"         "/example/**/*"))        ; implementation  

__Pascal Bourguignon__

Reply to: