Megatest

Diff
Login

Differences From Artifact [7425393881]:

To Artifact [a09b98476d]:


2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094











2095
2096
2097
2098
2099
2100
2101
2079
2080
2081
2082
2083
2084
2085









2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103







-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+







      '()))


;; clear vars matching pattern, run proc, set vars back
;; if proc is a string run that string as a command with
;; system.
;;
(define *common:orig-env* (if (get-environment-variable "MT_ORIG_ENV")
                              (with-input-from-string
                                  (z3:decode-buffer (base64:base64-decode (get-environment-variable "MT_ORIG_ENV")))
                                read)
                              (filter-map (lambda (x)
                                            (if (string-match "^MT_.*" (car x))
                                                #f
                                                x))
                                          (get-environment-variables))))
(define *common:orig-env*
  (let ((envvars (get-environment-variables)))
    (if (get-environment-variable "MT_ORIG_ENV")
        (with-input-from-string
            (z3:decode-buffer (base64:base64-decode (get-environment-variable "MT_ORIG_ENV")))
          read)
        (filter-map (lambda (x)
                      (if (string-match "^MT_.*" (car x))
                          #f
                          x))
                    envvars))))

(define (common:with-orig-env proc)
  (let  ((current-env (get-environment-variables)))
    (for-each (lambda (x) (unsetenv (car x)))             current-env)
    (for-each (lambda (x) (setenv (car x) (cdr x))) *common:orig-env*)
    (let ((rv (cond
               ((string? proc)(system proc))