aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEfraim Flashner <efraim@flashner.co.il>2024-07-23 20:21:11 +0300
committerEfraim Flashner <efraim@flashner.co.il>2024-07-23 20:26:59 +0300
commit56395b12f628c4b49e4df718cd333a6bd222f099 (patch)
treee777b9c15d2962b9130721fde4d07136c7c47347
parentc74401749a10e777950633252f445feac098744e (diff)
downloadguix-56395b12f628c4b49e4df718cd333a6bd222f099.tar
guix-56395b12f628c4b49e4df718cd333a6bd222f099.tar.gz
graft: Only create directory when needed.
* guix/build/graft.scm (rewrite-directory)[rewrite-leaf]: Only create the parent directories when they don't already exist. Change-Id: I802aac4d6090ed07effddde3eb3195f64aca31d3
-rw-r--r--guix/build/graft.scm3
1 files changed, 2 insertions, 1 deletions
diff --git a/guix/build/graft.scm b/guix/build/graft.scm
index 975544c7c8..49fabfea17 100644
--- a/guix/build/graft.scm
+++ b/guix/build/graft.scm
@@ -347,7 +347,8 @@ file name pairs."
(define (rewrite-leaf file)
(let ((stat (lstat file))
(dest (destination file)))
- (mkdir-p (dirname dest))
+ (unless (file-exists? (dirname dest))
+ (mkdir-p (dirname dest)))
(case (stat:type stat)
((symlink)
(let ((target (readlink file)))