Bläddra i källkod

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

Brit Butler 12 år sedan
förälder
incheckning
7630285df5
3 ändrade filer med 2 tillägg och 11 borttagningar
  1. 2 2
      src/coleslaw.lisp
  2. 0 1
      src/packages.lisp
  3. 0 8
      src/util.lisp

+ 2 - 2
src/coleslaw.lisp

53
         (with-current-directory coleslaw-conf:*basedir*
53
         (with-current-directory coleslaw-conf:*basedir*
54
           (run-program "mv" (mapcar #'namestring (list staging new-build)))
54
           (run-program "mv" (mapcar #'namestring (list staging new-build)))
55
           (when (probe-file prev)
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
           (when (probe-file curr)
57
           (when (probe-file curr)
58
-            (update-symlink prev (read-symlink curr)))
58
+            (update-symlink prev (truename curr)))
59
           (update-symlink curr new-build))))))
59
           (update-symlink curr new-build))))))
60
 
60
 
61
 (defun main ()
61
 (defun main ()

+ 0 - 1
src/packages.lisp

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

+ 0 - 8
src/util.lisp

5
 If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH."
5
 If ARGS is provided, use (apply 'format nil PATH ARGS) as the value of PATH."
6
   (merge-pathnames (apply 'format nil path args) coleslaw-conf:*basedir*))
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
 (defmacro do-files ((var path &optional extension) &body body)
8
 (defmacro do-files ((var path &optional extension) &body body)
17
   "For each file on PATH, run BODY. If EXTENSION is provided, only run BODY
9
   "For each file on PATH, run BODY. If EXTENSION is provided, only run BODY
18
 on files that match the given extension."
10
 on files that match the given extension."