From 07047c33e324ecf4bce23dc8191d7596e10133ea Mon Sep 17 00:00:00 2001 From: Matthias Benkard Date: Wed, 20 Feb 2008 00:00:12 +0100 Subject: When copying directories, leave the trailing slash off. darcs-hash:488cf5c585e76c845736f4c4ca18286e9a0dbadd --- objective-cl-libobjcl.asd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) 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 -- cgit v1.2.3