diff options
author | Ludovic Courtès <ludo@gnu.org> | 2020-06-06 23:00:05 +0200 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2020-06-06 23:28:49 +0200 |
commit | d67a88196607b57ce1209464b03b79d2a74bf5cd (patch) | |
tree | f274c092ddc968c58c4c129966ba3a43eeaa7cdc /guix/tests | |
parent | b2ee53d5aead4e2c49f526c8ddcf5a279e879236 (diff) |
utils: Add 'with-environment-variables'.
* guix/tests/gnupg.scm (call-with-environment-variables)
(with-environment-variables): Move to...
* guix/utils.scm: ... here.
* guix/tests/git.scm: Adjust accordingly.
Diffstat (limited to 'guix/tests')
-rw-r--r-- | guix/tests/git.scm | 1 | ||||
-rw-r--r-- | guix/tests/gnupg.scm | 22 |
2 files changed, 1 insertions, 22 deletions
diff --git a/guix/tests/git.scm b/guix/tests/git.scm index c77c544e03..5d7056bb53 100644 --- a/guix/tests/git.scm +++ b/guix/tests/git.scm @@ -21,7 +21,6 @@ #:use-module ((guix git) #:select (with-repository)) #:use-module (guix utils) #:use-module (guix build utils) - #:use-module ((guix tests gnupg) #:select (with-environment-variables)) #:use-module (ice-9 match) #:use-module (ice-9 control) #:export (git-command diff --git a/guix/tests/gnupg.scm b/guix/tests/gnupg.scm index 6e7fdbcf65..47c858d232 100644 --- a/guix/tests/gnupg.scm +++ b/guix/tests/gnupg.scm @@ -22,27 +22,7 @@ #:use-module (ice-9 match) #:export (gpg-command gpgconf-command - with-fresh-gnupg-setup - - with-environment-variables)) - -(define (call-with-environment-variables variables thunk) - "Call THUNK with the environment VARIABLES set." - (let ((environment (environ))) - (dynamic-wind - (lambda () - (for-each (match-lambda - ((variable value) - (setenv variable value))) - variables)) - thunk - (lambda () - (environ environment))))) - -(define-syntax-rule (with-environment-variables variables exp ...) - "Evaluate EXP with the given environment VARIABLES set." - (call-with-environment-variables variables - (lambda () exp ...))) + with-fresh-gnupg-setup)) (define gpg-command (make-parameter "gpg")) |