me
/
guix
Archived
1
0
Fork 0

install: Use 'reset-timestamps' from (guix store database).

* gnu/build/install.scm (reset-timestamps): Remove.
* gnu/build/vm.scm: Use 'reset-timestamps' from (guix store database).
master
Ludovic Courtès 2018-06-07 22:35:36 +02:00
parent 31a63be878
commit 078c2329c0
No known key found for this signature in database
GPG Key ID: 090B11993D9AEBB5
3 changed files with 1 additions and 16 deletions

View File

@ -26,7 +26,6 @@
#:export (install-boot-config #:export (install-boot-config
evaluate-populate-directive evaluate-populate-directive
populate-root-file-system populate-root-file-system
reset-timestamps
register-closure register-closure
populate-single-profile-directory)) populate-single-profile-directory))
@ -145,20 +144,6 @@ includes /etc, /var, /run, /bin/sh, etc., and all the symlinks to SYSTEM."
(try)) (try))
(apply throw args))))))) (apply throw args)))))))
(define (reset-timestamps directory)
"Reset the timestamps of all the files under DIRECTORY, so that they appear
as created and modified at the Epoch."
(display "clearing file timestamps...\n")
(for-each (lambda (file)
(let ((s (lstat file)))
;; XXX: Guile uses libc's 'utime' function (not 'futime'), so
;; the timestamp of symlinks cannot be changed, and there are
;; symlinks here pointing to /gnu/store, which is the host,
;; read-only store.
(unless (eq? (stat:type s) 'symlink)
(utime file 0 0 0 0))))
(find-files directory #:directories? #t)))
(define* (register-closure prefix closure (define* (register-closure prefix closure
#:key #:key
(deduplicate? #t) (reset-timestamps? #t) (deduplicate? #t) (reset-timestamps? #t)

View File

@ -25,6 +25,7 @@
#:use-module (guix build utils) #:use-module (guix build utils)
#:use-module (guix build store-copy) #:use-module (guix build store-copy)
#:use-module (guix build syscalls) #:use-module (guix build syscalls)
#:use-module ((guix store database) #:select (reset-timestamps))
#:use-module (gnu build linux-boot) #:use-module (gnu build linux-boot)
#:use-module (gnu build install) #:use-module (gnu build install)
#:use-module (gnu system uuid) #:use-module (gnu system uuid)

View File

@ -183,7 +183,6 @@ Every store item in REFERENCES must already be registered."
;;; High-level interface. ;;; High-level interface.
;;; ;;;
;; TODO: Factorize with that in (gnu build install).
(define (reset-timestamps file) (define (reset-timestamps file)
"Reset the modification time on FILE and on all the files it contains, if "Reset the modification time on FILE and on all the files it contains, if
it's a directory. While at it, canonicalize file permissions." it's a directory. While at it, canonicalize file permissions."