summary refs log tree commit diff
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-11-19 18:08:42 +0100
committerLudovic Courtès <ludo@gnu.org>2020-11-19 22:36:03 +0100
commit201cbcac3e9c23cc28352fa9ece3e677e22cc12c (patch)
tree1ce5b68a4f3cd6469561599df5c9ba7a3cfb1184
parentf6dbca83bf21b160bcd44d165a683318f6ba8d12 (diff)
downloadguix-201cbcac3e9c23cc28352fa9ece3e677e22cc12c.tar.gz
utils: 'copy-recursively' keeps directory mtime when #:keep-mtime? is true.
Fixes <https://bugs.gnu.org/44741>.

* guix/build/utils.scm (copy-recursively): Move 'set-file-time' call
from 'down' to 'up'.
-rw-r--r--guix/build/utils.scm9
1 files changed, 5 insertions, 4 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm
index bf57564c80..443a82046d 100644
--- a/guix/build/utils.scm
+++ b/guix/build/utils.scm
@@ -369,11 +369,12 @@ verbose output to the LOG port."
                     (lambda (dir stat result)     ; down
                       (let ((target (string-append destination
                                                    (strip-source dir))))
-                        (mkdir-p target)
-                        (when keep-mtime?
-                          (set-file-time target stat))))
+                        (mkdir-p target)))
                     (lambda (dir stat result)     ; up
-                      result)
+                      (when keep-mtime?
+                        (let ((target (string-append destination
+                                                     (strip-source dir))))
+                          (set-file-time target stat))))
                     (const #t)                    ; skip
                     (lambda (file stat errno result)
                       (format (current-error-port) "i/o error: ~a: ~a~%"