[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
06/19: guix: register-path: use new %store-database-directory
From: |
guix-commits |
Subject: |
06/19: guix: register-path: use new %store-database-directory |
Date: |
Tue, 29 Jan 2019 14:19:49 -0500 (EST) |
reepca pushed a commit to branch guile-daemon
in repository guix.
commit ec23842af8918190b55425f83e03841e2b9ddc1d
Author: Caleb Ristvedt <address@hidden>
Date: Mon Jun 5 22:34:59 2017 -0500
guix: register-path: use new %store-database-directory
* guix/config.scm.in (%store-database-directory): new variable.
* guix/store.scm (register-path): use variables from (guix config) instead
of
using environment variables directly.
---
guix/store.scm | 41 ++++++++++++++++++++++-------------------
1 file changed, 22 insertions(+), 19 deletions(-)
diff --git a/guix/store.scm b/guix/store.scm
index ca01b2a..b5aae45 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -1569,7 +1569,10 @@ makes a wrapper around a port which implements
GET-POSITION."
#:key (references '()) deriver prefix
state-directory)
;; Priority for options: first what is given, then environment variables,
- ;; then defaults.
+ ;; then defaults. %state-directory, %store-directory, and
+ ;; %store-database-directory already handle the "environment variables /
+ ;; defaults" question, so we only need to choose between what is given and
+ ;; those.
"Register PATH as a valid store file, with REFERENCES as its list of
references, and DERIVER as its deriver (.drv that led to it.) If PREFIX is
given, it must be the name of the directory containing the new store to
@@ -1583,28 +1586,28 @@ be used internally by the daemon's build hook."
(state-directory
(string-append state-directory "/db"))
(prefix
- (string-append prefix %state-directory "/db"))
- ((getenv "NIX_DB_DIR")
- (getenv "NIX_DB_DIR"))
- ((getenv "NIX_STATE_DIR")
- (string-append (getenv "NIX_STATE_DIR") "/db"))
+ ;; If prefix is specified, the value of NIX_STATE_DIR
+ ;; (which affects %state-directory) isn't supposed to
+ ;; affect db-dir, only the compile-time-customized
+ ;; default should.
+ (string-append prefix %localstatedir "/guix/db"))
(else
- (string-append %state-directory "/db"))))
+ %store-database-directory)))
(store-dir (if prefix
- (string-append prefix %store-directory)
- (or
- (getenv "NIX_STORE_DIR")
- (getenv "NIX_STORE")
- %store-directory)))
+ ;; same situation as above
+ (string-append prefix %storedir)
+ %store-directory))
(to-register (if prefix
- ;; note: we assume here that if path is, for example,
- ;; /foo/bar/gnu/store/thing.txt, then an environment
- ;; variable has been used to change the store
- ;; directory to /foo/bar/gnu/store.
- (string-append %store-directory "/" (basename path))
+ (string-append %storedir "/" (basename path))
+ ;; note: we assume here that if path is, for
+ ;; example, /foo/bar/gnu/store/thing.txt and prefix
+ ;; isn't given, then an environment variable has
+ ;; been used to change the store directory to
+ ;; /foo/bar/gnu/store, since otherwise real-path
+ ;; would end up being /gnu/store/thing.txt, which is
+ ;; probably not the right file in this case.
path))
- (real-path (string-append store-dir "/"
- (basename path))))
+ (real-path (string-append store-dir "/" (basename path))))
(let-values (((hash nar-size)
(nar-sha256 real-path)))
(sqlite-register
- branch guile-daemon created (now 10b0562), guix-commits, 2019/01/29
- 07/19: guix: register-path: reset timestamps after registering., guix-commits, 2019/01/29
- 01/19: patches: honor NIX_STORE in site.py., guix-commits, 2019/01/29
- 04/19: .dir-locals.el: properly indent sql macros., guix-commits, 2019/01/29
- 08/19: guix: register-path: do deduplication., guix-commits, 2019/01/29
- 12/19: linux-container: new use-output argument., guix-commits, 2019/01/29
- 02/19: guix: register-path: Implement prototype in scheme., guix-commits, 2019/01/29
- 05/19: guix: sql.scm: split into generic and store-specific parts., guix-commits, 2019/01/29
- 09/19: guix: register-path: return #t on success., guix-commits, 2019/01/29
- 03/19: guix: register-path: Honor environment variables., guix-commits, 2019/01/29
- 06/19: guix: register-path: use new %store-database-directory,
guix-commits <=
- 10/19: guix: register-path: use new %store-database-directory, guix-commits, 2019/01/29
- 16/19: build-derivations: Leaked environment variables more robust., guix-commits, 2019/01/29
- 19/19: gnu: linux-container: Make it more suitable for derivation-building., guix-commits, 2019/01/29
- 17/19: guix: store: Make register-items transactional, register drv outputs, guix-commits, 2019/01/29
- 14/19: build-derivations: initial build-group support, guix-commits, 2019/01/29
- 15/19: linux-container: don't include /dev/ptmx or /dev/pts from host., guix-commits, 2019/01/29
- 13/19: build-derivations: use call-with-container, guix-commits, 2019/01/29
- 18/19: guix: store: Adapt to using register-items instead of register-path., guix-commits, 2019/01/29
- 11/19: guix/store/build-derivations.scm: new module., guix-commits, 2019/01/29