diff options
Diffstat (limited to 'guix/web/package.scm')
-rw-r--r-- | guix/web/package.scm | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/guix/web/package.scm b/guix/web/package.scm index 5fcfe51..e91a59c 100644 --- a/guix/web/package.scm +++ b/guix/web/package.scm @@ -50,21 +50,26 @@ (unless (string=? profile %profile) (add-indirect-root store (canonicalize-path profile)))) +(define (install-new-profile-generation profile prof) + "Let PROF become the new generation of PROFILE." + (let* ((number (generation-number profile)) + (name (generation-file-name profile (+ 1 number)))) + (switch-symlinks name prof) + (switch-symlinks profile name) + ;; (maybe-register-gc-root (%store) profile) + )) + (define (package-install package) (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))))))) + (mbegin %store-monad + (set-guile-for-build (default-guile)) + (profile-derivation new)))) + (prof (derivation->output-path prof-drv))) + (and (build-derivations %store (list prof-drv)) + (install-new-profile-generation %profile prof))))) (define (profile-generations*) (map (lambda (n) |