gnunet-svn
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gnunet-scheme] 54/324: Add missing dependency ‘guix-stuff.scm’


From: gnunet
Subject: [gnunet-scheme] 54/324: Add missing dependency ‘guix-stuff.scm’
Date: Tue, 21 Sep 2021 13:21:34 +0200

This is an automated email from the git hooks/post-receive script.

maxime-devos pushed a commit to branch master
in repository gnunet-scheme.

commit 95303b4263d759a3f9635d631bad1088efc5b900
Author: Maxime Devos <maximedevos@telenet.be>
AuthorDate: Tue Jan 26 12:48:36 2021 +0100

    Add missing dependency ‘guix-stuff.scm’
    
    Fragment extracted from Guix source code.
    
    * gnu/gnunet/scripts/guix-stuff.scm
      (call-with-temporary-output-file): copy procedure from upstream
---
 gnu/gnunet/scripts/guix-stuff.scm | 38 ++++++++++++++++++++++++++++++++++++++
 1 file changed, 38 insertions(+)

diff --git a/gnu/gnunet/scripts/guix-stuff.scm 
b/gnu/gnunet/scripts/guix-stuff.scm
new file mode 100644
index 0000000..37f0601
--- /dev/null
+++ b/gnu/gnunet/scripts/guix-stuff.scm
@@ -0,0 +1,38 @@
+;;; Copyright © 2012, 2013, 2014 Ludovic Courtès <ludo@gnu.org>
+;;; Copyright © 2013 Mark H Weaver <mhw@netris.org>
+;;; Copyright © 2014 Eric Bavier <bavier@member.fsf.org>
+;;;
+;;; This file is part of GNU Guix.
+;;;
+;;; GNU Guix is free software; you can redistribute it and/or modify it
+;;; under the terms of the GNU General Public License as published by
+;;; the Free Software Foundation; either version 3 of the License, or (at
+;;; your option) any later version.
+;;;
+;;; GNU Guix is distributed in the hope that it will be useful, but
+;;; WITHOUT ANY WARRANTY; without even the implied warranty of
+;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+;;; GNU General Public License for more details.
+;;;
+;;; You should have received a copy of the GNU General Public License
+;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.
+
+(define-module (gnu gnunet scripts guix-stuff)
+  #:export (call-with-temporary-output-file))
+
+(define (call-with-temporary-output-file proc)
+  "Call PROC with a name of a temporary file and open output port to that
+file; close the file and delete it when leaving the dynamic extent of this
+call."
+  (let* ((directory (or (getenv "TMPDIR") "/tmp"))
+         (template  (string-append directory "/guix-file.XXXXXX"))
+         (out       (mkstemp! template)))
+    (dynamic-wind
+      (lambda ()
+        #t)
+      (lambda ()
+        (proc template out))
+      (lambda ()
+        (false-if-exception (close out))
+        (false-if-exception (delete-file template))))))
+

-- 
To stop receiving notification emails like this one, please contact
gnunet@gnunet.org.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]