From bca254886bb23864f1b56ed2dc5890cc64e4c4c1 Mon Sep 17 00:00:00 2001 From: Matt Birkholz Date: Sun, 18 Feb 2018 17:57:20 -0700 Subject: [PATCH] devops: Add subprocess environment variable set/unset procedures. --- src/devops/build.scm | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/devops/build.scm b/src/devops/build.scm index 8f2ead7e3..a2a326aca 100644 --- a/src/devops/build.scm +++ b/src/devops/build.scm @@ -357,6 +357,18 @@ Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. (vector-set! new new-i (string prefix value)) new)))) +(define (set-subprocess-environment-variable! name value) + (set! scheme-subprocess-environment + (setenv! name value scheme-subprocess-environment))) + +(define (delete-subprocess-environment-variable! name) + (set! scheme-subprocess-environment + (let ((prefix (string name"="))) + (list->vector + (filter (lambda (elt) + (not (string-prefix? prefix elt))) + (vector->list scheme-subprocess-environment)))))) + (let ((len (vector-length scheme-subprocess-environment))) (let loop ((i 0)) (if (fix:< i len) -- 2.25.1