build-system: copy-build-system: Keep symlinks symbolic.
authorLeo Prikler <leo.prikler@student.tugraz.at>
Thu, 27 Feb 2020 13:49:11 +0000 (14:49 +0100)
committerPierre Neidhardt <mail@ambrevar.xyz>
Fri, 28 Feb 2020 08:39:31 +0000 (09:39 +0100)
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 <mail@ambrevar.xyz>
guix/build/copy-build-system.scm

index 6d9dc8f..a86f0cd 100644 (file)
@@ -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