Changeset 9966


Ignore:
Timestamp:
09/13/05 04:27:14 (16 years ago)
Author:
piso
Message:

Work in progress (tested).

Location:
trunk/j/src/org/armedbear/lisp
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/j/src/org/armedbear/lisp/LogicalPathname.java

    r9964 r9966  
    33 *
    44 * Copyright (C) 2004-2005 Peter Graves
    5  * $Id: LogicalPathname.java,v 1.12 2005-09-12 23:30:28 piso Exp $
     5 * $Id: LogicalPathname.java,v 1.13 2005-09-13 04:26:44 piso Exp $
    66 *
    77 * This program is free software; you can redistribute it and/or
     
    4343            directory = parseDirectory(d);
    4444            rest = rest.substring(semi + 1);
     45        } else {
     46            // "If a relative-directory-marker precedes the directories, the
     47            // directory component parsed is as relative; otherwise, the
     48            // directory component is parsed as absolute."
     49            directory = new Cons(Keyword.ABSOLUTE);
    4550        }
    4651
  • trunk/j/src/org/armedbear/lisp/pathnames.lisp

    r9964 r9966  
    22;;;
    33;;; Copyright (C) 2003-2005 Peter Graves
    4 ;;; $Id: pathnames.lisp,v 1.14 2005-09-12 23:31:34 piso Exp $
     4;;; $Id: pathnames.lisp,v 1.15 2005-09-13 04:27:14 piso Exp $
    55;;;
    66;;; This program is free software; you can redistribute it and/or
     
    5151  (loop
    5252    (cond ((endp thing)
    53            (return (endp wild)))
     53           (return (or (endp wild) (equal wild '(:wild-inferiors)))))
    5454          ((endp wild)
    5555           (return nil)))
     
    133133  ;; FIXME The IGNORE-CASE argument to DIRECTORY-MATCH-P should not be nil on
    134134  ;; Windows or if the source pathname is a logical pathname.
     135  ;; FIXME We can canonicalize logical pathnames to upper case, so we only need
     136  ;; IGNORE-CASE for Windows.
     137
     138  ;; FIXME We already know they match, so we don't need this here.
    135139  (unless (directory-match-p source from nil)
    136140    (error "~S and ~S do not match." source from))
     
    140144;; replaced by a portion of SOURCE."
    141145(defun translate-pathname (source from-wildcard to-wildcard &key)
     146  (unless (pathname-match-p source from-wildcard)
     147    (error "~S and ~S do not match." source from-wildcard))
    142148  (let ((source (pathname source))
    143149        (from   (pathname from-wildcard))
     
    172178                    *logical-pathname-translations*))
    173179
    174 (defun %set-logical-pathname-translations (host new-translations)
     180(defun canonicalize-logical-pathname-translations (translations host)
     181;;   (mapcar (lambda (translation)
     182;;             (destructuring-bind (from to) translation
     183;;                                 (list (if (typep from 'logical-pathname)
     184;;                                           from
     185;;                                           (parse-namestring from host))
     186;;                                       (pathname to))))
     187;;           translation-list))
     188  (let (result)
     189    (dolist (translation translations (nreverse result))
     190      (let ((from (car translation))
     191            (to (cadr translation)))
     192        (push (list (if (typep from 'logical-pathname)
     193                        from
     194                        (parse-namestring from host))
     195                    (pathname to))
     196              result)))))
     197
     198(defun %set-logical-pathname-translations (host translations)
    175199  (setf (gethash (canonicalize-logical-hostname host)
    176200                 *logical-pathname-translations*)
    177         new-translations))
     201;;         (canonicalize-logical-pathname-translations translations host)))
     202        translations))
    178203
    179204(defun logical-host-p (host)
Note: See TracChangeset for help on using the changeset viewer.