aboutsummaryrefslogtreecommitdiff
path: root/guix/nar.scm
diff options
context:
space:
mode:
Diffstat (limited to 'guix/nar.scm')
-rw-r--r--guix/nar.scm17
1 files changed, 9 insertions, 8 deletions
diff --git a/guix/nar.scm b/guix/nar.scm
index 3556de1379..8894f10d2b 100644
--- a/guix/nar.scm
+++ b/guix/nar.scm
@@ -22,12 +22,16 @@
#:use-module (guix build syscalls)
#:use-module ((guix build utils)
#:select (delete-file-recursively with-directory-excursion))
+
+ ;; XXX: Eventually we should use (guix store database) exclusively, and not
+ ;; (guix store) since this is "daemon-side" code.
#:use-module (guix store)
#:use-module (guix store database)
+
#:use-module (guix ui) ; for '_'
- #:use-module (guix hash)
+ #:use-module (gcrypt hash)
#:use-module (guix pki)
- #:use-module (guix pk-crypto)
+ #:use-module (gcrypt pk-crypto)
#:use-module (srfi srfi-1)
#:use-module (srfi srfi-11)
#:use-module (srfi srfi-26)
@@ -88,15 +92,12 @@
REFERENCES and DERIVER. When LOCK? is true, acquire exclusive locks on TARGET
before attempting to register it; otherwise, assume TARGET's locks are already
held."
-
- ;; XXX: Currently we have to call out to the daemon to check whether TARGET
- ;; is valid.
- (with-store store
- (unless (valid-path? store target)
+ (with-database %default-database-file db
+ (unless (path-id db target)
(when lock?
(lock-store-file target))
- (unless (valid-path? store target)
+ (unless (path-id db target)
;; If FILE already exists, delete it (it's invalid anyway.)
(when (file-exists? target)
(delete-file-recursively target))