GNU bug report logs - #30657
Add support for file-like objects to the Prosody configuration

Previous Next

Package: guix-patches;

Reported by: Clément Lassieur <clement <at> lassieur.org>

Date: Wed, 28 Feb 2018 22:27:02 UTC

Severity: normal

Done: Clément Lassieur <clement <at> lassieur.org>

Bug is archived. No further changes may be made.

Full log


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

From: Clément Lassieur <clement <at> lassieur.org>
To: 30657 <at> debbugs.gnu.org
Subject: [PATCH 2/4] gexp: Add 'file-like?'.
Date: Wed, 28 Feb 2018 23:28:19 +0100
* guix/gexp.scm (file-like?): New exported procedure.
---
 guix/gexp.scm | 11 +++++++++++
 1 file changed, 11 insertions(+)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index f005c4d29..9a30579a6 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -1,5 +1,6 @@
 ;;; GNU Guix --- Functional package management for GNU
 ;;; Copyright © 2014, 2015, 2016, 2017 Ludovic Courtès <ludo <at> gnu.org>
+;;; Copyright © 2018 Clément Lassieur <clement <at> lassieur.org>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -70,6 +71,8 @@
             file-append-base
             file-append-suffix
 
+            file-like?
+
             load-path-expression
             gexp-modules
 
@@ -437,6 +440,14 @@ SUFFIX."
                           (base   (expand base lowered output)))
                      (string-append base (string-concatenate suffix)))))))
 
+(define (file-like? object)
+  (or (local-file? object)
+      (plain-file? object)
+      (computed-file? object)
+      (program-file? object)
+      (scheme-file? object)
+      (file-append? object)))
+
 
 ;;;
 ;;; Inputs & outputs.
-- 
2.16.2





This bug report was last modified 7 years and 167 days ago.

Previous Next


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