summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvgeny Pisemsky <mail@pisemsky.site>2026-07-23 18:50:03 +0300
committerLudovic Courtès <ludo@gnu.org>2026-07-23 23:45:30 +0200
commit36d403cfd77ff5452978cf94425902675e6ad81b (patch)
tree83051b32530ccaf4076474eaecc7f13ab35ba1cf
parentd8ccd4af95f8c641f03892a6d308e20aa3846ad0 (diff)
scripts: system: Remove unused syntax.
* guix/scripts/system.scm (save-environment-excursion): Remove syntax. * tests/profiles.scm (with-environment-excursion): Prepare syntax for reuse. Signed-off-by: Ludovic Courtès <ludo@gnu.org> Modified-by: Ludovic Courtès <ludo@gnu.org> Merges: #10134
-rw-r--r--guix/scripts/system.scm11
-rw-r--r--tests/profiles.scm6
2 files changed, 4 insertions, 13 deletions
diff --git a/guix/scripts/system.scm b/guix/scripts/system.scm
index b9c60918f36..8277e24e5f7 100644
--- a/guix/scripts/system.scm
+++ b/guix/scripts/system.scm
@@ -133,20 +133,9 @@ BODY..., and restore them."
133 (set! %load-path path) 133 (set! %load-path path)
134 (set! %load-compiled-path cpath))))) 134 (set! %load-compiled-path cpath)))))
135 135
136(define-syntax-rule (save-environment-excursion body ...)
137 "Save the current environment variables, run BODY..., and restore them."
138 (let ((env (environ)))
139 (dynamic-wind
140 (const #t)
141 (lambda ()
142 body ...)
143 (lambda ()
144 (environ env)))))
145
146(define topologically-sorted* 136(define topologically-sorted*
147 (store-lift topologically-sorted)) 137 (store-lift topologically-sorted))
148 138
149
150(define* (copy-item item info target db 139(define* (copy-item item info target db
151 #:key (log-port (current-error-port))) 140 #:key (log-port (current-error-port)))
152 "Copy ITEM to the store under root directory TARGET and populate DB with the 141 "Copy ITEM to the store under root directory TARGET and populate DB with the
diff --git a/tests/profiles.scm b/tests/profiles.scm
index 55e7146a7a0..e2472aa9e85 100644
--- a/tests/profiles.scm
+++ b/tests/profiles.scm
@@ -367,11 +367,13 @@
367 (profile -> (derivation->output-path drv)) 367 (profile -> (derivation->output-path drv))
368 (bindir -> (string-append profile "/bin")) 368 (bindir -> (string-append profile "/bin"))
369 (_ (built-derivations (list drv)))) 369 (_ (built-derivations (list drv))))
370 (define-syntax-rule (with-environment-excursion exp ...) 370 (define-syntax-rule (with-environment-excursion body ...)
371 ;; Save the current environment variables, run BODY..., and restore
372 ;; them.
371 (let ((env (environ))) 373 (let ((env (environ)))
372 (dynamic-wind 374 (dynamic-wind
373 (const #t) 375 (const #t)
374 (lambda () exp ...) 376 (lambda () body ...)
375 (lambda () (environ env))))) 377 (lambda () (environ env)))))
376 378
377 (return (and (with-environment-excursion 379 (return (and (with-environment-excursion