diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-12-11 10:37:06 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-12-15 17:32:11 +0100 |
commit | cd6c5ddfc8a1a0a6f4085c8201fca20fd819bdfd (patch) | |
tree | e8738652d1e1cb5ffa4e670df47331f73fa7331b /guix/scripts/system.scm | |
parent | 0793833c59e727d5d471fe46c8e0e44c811b9621 (diff) |
guix system: 'init' copies, resets timestamps, and deduplicates at once.
Partly fixes <https://bugs.gnu.org/44760>.
* guix/build/store-copy.scm (copy-store-item): New procedure.
(populate-store): Use it instead of the inline 'copy-recursively' call.
* guix/scripts/system.scm (copy-item): Likewise.
Pass #:reset-timestamps? and #:deduplicate? to 'register-path'.
Diffstat (limited to 'guix/scripts/system.scm')
-rw-r--r-- | guix/scripts/system.scm | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm index db80e0be8f..c08929066b 100644 --- a/guix/scripts/system.scm +++ b/guix/scripts/system.scm @@ -30,6 +30,7 @@ #:use-module ((guix status) #:select (with-status-verbosity)) #:use-module (guix store) #:autoload (guix store database) (register-path) + #:autoload (guix build store-copy) (copy-store-item) #:use-module (guix describe) #:use-module (guix grafts) #:use-module (guix gexp) @@ -147,8 +148,8 @@ REFERENCES as its set of references." #:directories? #t)) (delete-file-recursively dest)) - (copy-recursively item dest - #:log (%make-void-port "w")) + (copy-store-item item target + #:deduplicate? #t) ;; Register ITEM; as a side-effect, it resets timestamps, etc. ;; Explicitly use "TARGET/var/guix" as the state directory, to avoid @@ -157,7 +158,11 @@ REFERENCES as its set of references." (unless (register-path item #:prefix target #:state-directory state - #:references references) + #:references references + + ;; Those are taken care of by 'copy-store-item'. + #:reset-timestamps? #f + #:deduplicate? #f) (leave (G_ "failed to register '~a' under '~a'~%") item target)))) |