guix-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

06/17: guix: register-path: reset timestamps after registering.


From: Caleb Ristvedt
Subject: 06/17: guix: register-path: reset timestamps after registering.
Date: Tue, 29 Aug 2017 02:07:48 -0400 (EDT)

reepca pushed a commit to branch guile-daemon
in repository guix.

commit ade506e2d52b86908a560403aa427dc48aee0776
Author: Caleb Ristvedt <address@hidden>
Date:   Tue Jun 6 00:04:54 2017 -0500

    guix: register-path: reset timestamps after registering.
    
    * guix/store.scm (register-path): Now resets timestamps.
---
 guix/store.scm | 24 ++++++++++++++----------
 1 file changed, 14 insertions(+), 10 deletions(-)

diff --git a/guix/store.scm b/guix/store.scm
index b0e0fd2..bcdb922 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -45,6 +45,7 @@
   #:use-module (web uri)
   #:use-module (sqlite3)
   #:use-module (guix store database)
+  #:use-module (gnu build install)
   #:export (%daemon-socket-uri
             %gc-roots-directory
             %default-substitute-urls
@@ -1339,17 +1340,14 @@ makes a wrapper around a port which implements 
GET-POSITION."
         (values hash
                 size)))))
 
-;; TODO: make this canonicalize store items that are registered. This involves
-;; setting permissions and timestamps, I think. Also, run a "deduplication
-;; pass", whatever that involves. Also, handle databases not existing yet
-;; (what should the default behavior be?  Figuring out how the C++ stuff
-;; currently does it sounds like a lot of grepping for global
-;; variables...). Also, return #t on success like the documentation says we
-;; should.
+;; TODO: Run a "deduplication pass", whatever that involves. Also, handle
+;; databases not existing yet (what should the default behavior be?  Figuring
+;; out how the C++ stuff currently does it sounds like a lot of grepping for
+;; global variables...). Also, return #t on success like the documentation
+;; says we should.
 
 (define* (register-path path
-                        #:key (references '()) deriver prefix
-                        state-directory)
+                        #:key (references '()) deriver prefix state-directory)
   ;; Priority for options: first what is given, then environment variables,
   ;; then defaults. %state-directory, %store-directory, and
   ;; %store-database-directory already handle the "environment variables /
@@ -1399,7 +1397,13 @@ be used internally by the daemon's build hook."
        #:deriver deriver
        #:hash (string-append "sha256:"
                              (bytevector->base16-string hash))
-       #:nar-size nar-size))))
+       #:nar-size nar-size)
+      ;; reset-timestamps prints a message on each invocation that we probably
+      ;; don't want.
+      (with-output-to-port 
+          (%make-void-port "w")
+        (lambda ()
+          (reset-timestamps real-path))))))
 
 
 ;;;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]