summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Benkard <code@mail.matthias.benkard.de>2008-02-20 00:00:12 +0100
committerMatthias Benkard <code@mail.matthias.benkard.de>2008-02-20 00:00:12 +0100
commit07047c33e324ecf4bce23dc8191d7596e10133ea (patch)
tree65d539014b179e3f3946a1d9cba0a3d5b21ee3b6
parent0f5b429c85b94c1655b0e1fa186d51510137e9a5 (diff)
When copying directories, leave the trailing slash off.
darcs-hash:488cf5c585e76c845736f4c4ca18286e9a0dbadd
-rw-r--r--objective-cl-libobjcl.asd10
1 files changed, 9 insertions, 1 deletions
diff --git a/objective-cl-libobjcl.asd b/objective-cl-libobjcl.asd
index b1538b2..fb84218 100644
--- a/objective-cl-libobjcl.asd
+++ b/objective-cl-libobjcl.asd
@@ -115,6 +115,14 @@
:serial t)
+(defun sanitise-dir-name (pathname)
+ ;; "/bla/stuff///" -> "/bla/stuff"
+ (loop with dir-name = (namestring pathname)
+ while (char= #\/ (elt dir-name (1- (length dir-name))))
+ do (setq dir-name (subseq dir-name 0 (1- (length dir-name))))
+ finally (return-from sanitise-dir-name dir-name)))
+
+
(defmethod perform :before (o (c objc-source-file))
;; Copy the Objective-C sources to the target directory.
(let ((output-files
@@ -162,7 +170,7 @@
source-dir
output-parent-dir)))
(zerop (run-shell-command "cp -R -P -f -p '~A' '~A/'"
- source-dir
+ (sanitise-dir-name source-dir)
output-parent-dir)))))
;; We couldn't use cp. Copy the files manually.
(let ((sources