Ditch READ-SYMLINK and friends. TRUENAME will do fine.

This commit is contained in:
Brit Butler 2012-08-29 00:29:47 -04:00
parent 648e66388d
commit 7630285df5
3 changed files with 2 additions and 11 deletions

View file

@ -53,9 +53,9 @@ If RAW is non-nil, write the content without wrapping it in the base template."
(with-current-directory coleslaw-conf:*basedir* (with-current-directory coleslaw-conf:*basedir*
(run-program "mv" (mapcar #'namestring (list staging new-build))) (run-program "mv" (mapcar #'namestring (list staging new-build)))
(when (probe-file prev) (when (probe-file prev)
(cl-fad:delete-directory-and-files (read-symlink prev))) (cl-fad:delete-directory-and-files (truename prev)))
(when (probe-file curr) (when (probe-file curr)
(update-symlink prev (read-symlink curr))) (update-symlink prev (truename curr)))
(update-symlink curr new-build)))))) (update-symlink curr new-build))))))
(defun main () (defun main ()

View file

@ -3,7 +3,6 @@
(:use :cl :closure-template) (:use :cl :closure-template)
(:import-from :iolib.os #:with-current-directory (:import-from :iolib.os #:with-current-directory
#:run-program) #:run-program)
(:import-from :iolib.pathnames #:file-path-namestring)
(:import-from :alexandria #:hash-table-values (:import-from :alexandria #:hash-table-values
#:make-keyword) #:make-keyword)
(:export #:main (:export #:main

View file

@ -5,14 +5,6 @@
If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH." If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH."
(merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*)) (merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*))
(defun to-pathname (file &optional (parent coleslaw-conf:*basedir*))
"Convert an iolib file-path back to a pathname."
(merge-pathnames (file-path-namestring file) parent))
(defun read-symlink (path)
"A trivial wrapper over iolib.os that returns the pathname in the symlink PATH."
(to-pathname (iolib.os:read-symlink path)))
(defmacro do-files ((var path &optional extension) &body body) (defmacro do-files ((var path &optional extension) &body body)
"For each file on PATH, run BODY. If EXTENSION is provided, only run BODY "For each file on PATH, run BODY. If EXTENSION is provided, only run BODY
on files that match the given extension." on files that match the given extension."