Skip to content

Commit

Permalink
Add & use PROBE-DIRECTORY for client updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
xach committed Mar 12, 2011
1 parent e8f9aa4 commit e6f5474
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client-update.lisp
Expand Up @@ -39,7 +39,7 @@
(let* ((try (format nil "~A-~D" base suffix))
(dir (qmerge (make-pathname :directory
(list :relative "retired" try)))))
(unless (ignore-errors (truename dir))
(unless (probe-directory dir)
(return dir))))))

(defun update-client (&key (prompt t))
Expand Down
11 changes: 11 additions & 0 deletions impl-util.lisp
Expand Up @@ -32,6 +32,17 @@
(ql-clisp:rename-directory from to)
(truename to)))

(definterface probe-directory (pathname)
(:implementation t
(let ((directory (probe-file pathname)))
(when directory
;; probe-file is specified to return the truename of the path,
;; but Allegro does not return the truename; truenamize it.
(truename directory))))
(:implementation clisp
(let ((directory (ql-clisp:probe-pathname pathname)))
(when (and directory (ql-clisp:probe-directory directory))
directory))))

(definterface init-file-name ()
(:implementation allegro
Expand Down
2 changes: 2 additions & 0 deletions impl.lisp
Expand Up @@ -153,6 +153,8 @@
(:reexport-from #:ext
#:delete-dir
#:rename-directory
#:probe-directory
#:probe-pathname
#:read-byte-sequence))


Expand Down
1 change: 1 addition & 0 deletions package.lisp
Expand Up @@ -46,6 +46,7 @@
#:add-to-init-file
#:rename-directory
#:delete-directory
#:probe-directory
#:directory-entries
#:delete-directory-tree))

Expand Down

0 comments on commit e6f5474

Please sign in to comment.