From a3b1f878dfeddfc8516fba8483e3191a3e4c887e Mon Sep 17 00:00:00 2001 From: Leo Prikler Date: Thu, 27 Feb 2020 14:49:11 +0100 Subject: build-system: copy-build-system: Keep symlinks symbolic. guix/build/copy-build-system.scm (install)[install-file]: Read symlinks as is done in install-simple through copy-recursively. Signed-off-by: Pierre Neidhardt --- guix/build/copy-build-system.scm | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/guix/build/copy-build-system.scm b/guix/build/copy-build-system.scm index 6d9dc8f93b..a86f0cde29 100644 --- a/guix/build/copy-build-system.scm +++ b/guix/build/copy-build-system.scm @@ -91,7 +91,13 @@ if TARGET ends with a '/', the source is installed underneath." file)))) (format (current-output-port) "`~a' -> `~a'~%" file dest) (mkdir-p (dirname dest)) - (copy-file file dest))) + (let ((stat (lstat file))) + (case (stat:type stat) + ((symlink) + (let ((target (readlink file))) + (symlink target dest))) + (else + (copy-file file dest)))))) (define* (make-file-predicate suffixes matches-regexp #:optional (default-value #t)) "Return a predicate that returns #t if its file argument matches the -- cgit v1.2.3