diff options
author | David Thompson <dthompson2@worcester.edu> | 2014-08-29 23:58:59 -0400 |
---|---|---|
committer | David Thompson <dthompson2@worcester.edu> | 2014-08-29 23:58:59 -0400 |
commit | ca0e7fc074f36853601d1ee892d1f22e04a26cc0 (patch) | |
tree | 3cfd2db75659335152a84eb4253415e5dd5471b4 | |
parent | fa0bde837292f18a9f1bd61473ff4798008f4304 (diff) |
package: Do not open store connection upon module load.
* guix-web/package.scm (%store): Delete it.
(package-install): Use with-store.
-rw-r--r-- | guix-web/package.scm | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/guix-web/package.scm b/guix-web/package.scm index 845eba7..ae7c152 100644 --- a/guix-web/package.scm +++ b/guix-web/package.scm @@ -28,7 +28,6 @@ #:use-module (gnu packages) #:export (package-install)) -(define %store (open-connection)) (define %profile (string-append "/usr/var/guix/profiles/per-user/" (getenv "USER") "/guix-profile")) @@ -40,16 +39,17 @@ (add-indirect-root store (canonicalize-path profile)))) (define (package-install package) - (let* ((new (manifest-add manifest - (list (package->manifest-entry package)))) - (prof-drv (run-with-store %store - (profile-derivation new))) - (prof (derivation->output-path prof-drv))) - (let* ((number (generation-number %profile)) - (name (generation-file-name %profile - (+ 1 number)))) - (and (build-derivations %store (list prof-drv)) - (let* ((entries (manifest-entries new)) - (count (length entries))) - (switch-symlinks name prof) - (switch-symlinks %profile name)))))) + (with-store %store + (let* ((new (manifest-add manifest + (list (package->manifest-entry package)))) + (prof-drv (run-with-store %store + (profile-derivation new))) + (prof (derivation->output-path prof-drv))) + (let* ((number (generation-number %profile)) + (name (generation-file-name %profile + (+ 1 number)))) + (and (build-derivations %store (list prof-drv)) + (let* ((entries (manifest-entries new)) + (count (length entries))) + (switch-symlinks name prof) + (switch-symlinks %profile name))))))) |