[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
01/03: build-system: copy-build-system: Keep symlinks symbolic.
From: |
guix-commits |
Subject: |
01/03: build-system: copy-build-system: Keep symlinks symbolic. |
Date: |
Fri, 28 Feb 2020 03:40:32 -0500 (EST) |
ambrevar pushed a commit to branch master
in repository guix.
commit a3b1f878dfeddfc8516fba8483e3191a3e4c887e
Author: Leo Prikler <address@hidden>
AuthorDate: Thu Feb 27 14:49:11 2020 +0100
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 <address@hidden>
---
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 6d9dc8f..a86f0cd 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