guix-commits
[Top][All Lists]
Advanced

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

01/03: gexp: 'local-file' calls 'canonicalize-path' only in rare cases.


From: Ludovic Courtès
Subject: 01/03: gexp: 'local-file' calls 'canonicalize-path' only in rare cases.
Date: Mon, 26 Jun 2017 17:22:26 -0400 (EDT)

civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.

commit 7188ebe982ed1cbe04e7e98e7a2aac412b63d26b
Author: Ludovic Courtès <address@hidden>
Date:   Mon Jun 26 17:41:08 2017 +0200

    gexp: 'local-file' calls 'canonicalize-path' only in rare cases.
    
    * guix/gexp.scm (absolute-file-name): Call 'canonicalize-path' only when
    DIRECTORY is #f or is not absolute.
---
 guix/gexp.scm | 11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/guix/gexp.scm b/guix/gexp.scm
index 35f991f..d825105 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -269,12 +269,11 @@ The expander specifies how an object is converted to its 
sexp representation."
 (define (absolute-file-name file directory)
   "Return the canonical absolute file name for FILE, which lives in the
 vicinity of DIRECTORY."
-  (canonicalize-path
-   (cond ((string-prefix? "/" file) file)
-         ((not directory) file)
-         ((string-prefix? "/" directory)
-          (string-append directory "/" file))
-         (else file))))
+  (cond ((string-prefix? "/" file) file)
+        ((not directory) (canonicalize-path file))
+        ((string-prefix? "/" directory)
+         (string-append directory "/" file))
+        (else (canonicalize-path file))))
 
 (define-syntax-rule (local-file file rest ...)
   "Return an object representing local file FILE to add to the store; this



reply via email to

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