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'.
This commit is contained in:
Ludovic Courtès 2020-11-19 18:08:42 +01:00
parent f6dbca83bf
commit 201cbcac3e
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5

View File

@ -369,11 +369,12 @@ verbose output to the LOG port."
(lambda (dir stat result) ; down (lambda (dir stat result) ; down
(let ((target (string-append destination (let ((target (string-append destination
(strip-source dir)))) (strip-source dir))))
(mkdir-p target) (mkdir-p target)))
(when keep-mtime?
(set-file-time target stat))))
(lambda (dir stat result) ; up (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 (const #t) ; skip
(lambda (file stat errno result) (lambda (file stat errno result)
(format (current-error-port) "i/o error: ~a: ~a~%" (format (current-error-port) "i/o error: ~a: ~a~%"