aboutsummaryrefslogtreecommitdiff
path: root/guix/store.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-08-28 15:05:17 +0200
committerLudovic Courtès <ludo@gnu.org>2020-08-28 23:27:53 +0200
commit3d9ea605c8dfb7fc43689e12975218b032b3175a (patch)
tree5bd465a5cfa605ff65125db071e62f80246d16dd /guix/store.scm
parentb6308409206af78356ea7d1b2c4613ca1ee4315c (diff)
downloadguix-3d9ea605c8dfb7fc43689e12975218b032b3175a.tar
guix-3d9ea605c8dfb7fc43689e12975218b032b3175a.tar.gz
store: 'with-store' returns as many values as its body.
Fixes <https://bugs.gnu.org/42912>. Reported by Ricardo Wurmus <rekado@elephly.net>. * guix/store.scm (call-with-store)[thunk]: Wrap call to PROC in 'call-with-values'. * tests/store.scm ("with-store, multiple values"): New test.
Diffstat (limited to 'guix/store.scm')
-rw-r--r--guix/store.scm7
1 files changed, 4 insertions, 3 deletions
diff --git a/guix/store.scm b/guix/store.scm
index 683e125b20..495dc1692c 100644
--- a/guix/store.scm
+++ b/guix/store.scm
@@ -628,9 +628,10 @@ connection. Use with care."
(define (thunk)
(parameterize ((current-store-protocol-version
(store-connection-version store)))
- (let ((result (proc store)))
- (close-connection store)
- result)))
+ (call-with-values (lambda () (proc store))
+ (lambda results
+ (close-connection store)
+ (apply values results)))))
(cond-expand
(guile-3