diff options
author | Ludovic Courtès <ludo@gnu.org> | 2014-04-14 00:08:54 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2014-04-14 00:09:42 +0200 |
commit | 8d846470f2201b47485f6239e8746d5a6ee2c0a9 (patch) | |
tree | 2012da3601d2818790050364f4ad74c1e844384b /guix/build/utils.scm | |
parent | 4eb202a3d80bf3129a9b4b8b12f051f8ce184c9e (diff) | |
download | gnu-guix-8d846470f2201b47485f6239e8746d5a6ee2c0a9.tar gnu-guix-8d846470f2201b47485f6239e8746d5a6ee2c0a9.tar.gz |
build-system/gnu: Reset timestamps on build tree when source is a directory.
* guix/build/utils.scm (copy-recursively): Add #:keep-mtime? parameter
and honor it.
* guix/build/gnu-build-system.scm (unpack): Use #:keep-mtime? #t.
* gnu/packages/admin.scm (shadow)[arguments]: Remove 'reset-timestamps'
phase.
Diffstat (limited to 'guix/build/utils.scm')
-rw-r--r-- | guix/build/utils.scm | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 40af785b88..9779278167 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -134,9 +134,12 @@ return values of applying PROC to the port." (define* (copy-recursively source destination #:key (log (current-output-port)) - (follow-symlinks? #f)) + (follow-symlinks? #f) + keep-mtime?) "Copy SOURCE directory to DESTINATION. Follow symlinks if FOLLOW-SYMLINKS? -is true; otherwise, just preserve them. Write verbose output to the LOG port." +is true; otherwise, just preserve them. When KEEP-MTIME? is true, keep the +modification time of the files in SOURCE on those of DESTINATION. Write +verbose output to the LOG port." (define strip-source (let ((len (string-length source))) (lambda (file) @@ -152,10 +155,15 @@ is true; otherwise, just preserve them. Write verbose output to the LOG port." (let ((target (readlink file))) (symlink target dest))) (else - (copy-file file dest))))) + (copy-file file dest) + (when keep-mtime? + (set-file-time dest stat)))))) (lambda (dir stat result) ; down - (mkdir-p (string-append destination - (strip-source dir)))) + (let ((target (string-append destination + (strip-source dir)))) + (mkdir-p target) + (when keep-mtime? + (set-file-time target stat)))) (lambda (dir stat result) ; up result) (const #t) ; skip |