Explorar el Código

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

Brit Butler hace 12 años
padre
commit
7630285df5
Se han modificado 3 ficheros con 2 adiciones y 11 borrados
  1. 2 2
      src/coleslaw.lisp
  2. 0 1
      src/packages.lisp
  3. 0 8
      src/util.lisp

+ 2 - 2
src/coleslaw.lisp

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

+ 0 - 1
src/packages.lisp

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

+ 0 - 8
src/util.lisp

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