From ca0e7fc074f36853601d1ee892d1f22e04a26cc0 Mon Sep 17 00:00:00 2001 From: David Thompson Date: Fri, 29 Aug 2014 23:58:59 -0400 Subject: package: Do not open store connection upon module load. * guix-web/package.scm (%store): Delete it. (package-install): Use with-store. --- guix-web/package.scm | 28 ++++++++++++++-------------- 1 file 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))))))) -- cgit v1.2.3