GNU bug report logs - #34638
[PATCH 0/4] Isolated inferiors.

Previous Next

Package: guix-patches;

Reported by: Christopher Baines <mail <at> cbaines.net>

Date: Sun, 24 Feb 2019 16:13:02 UTC

Severity: normal

Tags: patch

Full log


Message #32 received at 34638 <at> debbugs.gnu.org (full text, mbox):

From: Christopher Baines <mail <at> cbaines.net>
To: 34638 <at> debbugs.gnu.org
Subject: [PATCH v2 1/4] utils: Add #:base-directory to
 call-with-temporary-directory.
Date: Fri, 19 Apr 2019 15:04:24 +0100
This allows more easily creating temporary directories within a specific
directory. This is motivated by using this in inferior-eval-with-store.

* guix/utils.scm (call-with-temporary-directory): Add optional keyword
argument, base-directory.
---
 guix/utils.scm | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/guix/utils.scm b/guix/utils.scm
index ed1a418cca..abeb156f40 100644
--- a/guix/utils.scm
+++ b/guix/utils.scm
@@ -620,10 +620,10 @@ call."
         (false-if-exception (close out))
         (false-if-exception (delete-file template))))))
 
-(define (call-with-temporary-directory proc)
+(define* (call-with-temporary-directory proc #:key base-directory)
   "Call PROC with a name of a temporary directory; close the directory and
 delete it when leaving the dynamic extent of this call."
-  (let* ((directory (or (getenv "TMPDIR") "/tmp"))
+  (let* ((directory (or base-directory (getenv "TMPDIR") "/tmp"))
          (template  (string-append directory "/guix-directory.XXXXXX"))
          (tmp-dir   (mkdtemp! template)))
     (dynamic-wind
-- 
2.21.0





This bug report was last modified 5 years and 78 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.