[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
12/16: gexp: 'local-file' calls 'canonicalize-path' only in rare cases.
From: |
Ludovic Courtès |
Subject: |
12/16: gexp: 'local-file' calls 'canonicalize-path' only in rare cases. |
Date: |
Wed, 28 Jun 2017 17:48:56 -0400 (EDT) |
civodul pushed a commit to branch wip-build-systems-gexp
in repository guix.
commit 30408fc33589be38766cdea7248de6bf36ea3325
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
- branch wip-build-systems-gexp created (now 6ce5f33), Ludovic Courtès, 2017/06/28
- 08/16: packages: Simplify patch instantiation., Ludovic Courtès, 2017/06/28
- 03/16: gexp: Micro-optimize sexp serialization., Ludovic Courtès, 2017/06/28
- 04/16: tests: Add 'test-assertm' to (guix tests)., Ludovic Courtès, 2017/06/28
- 13/16: utils: Memoize 'absolute-dirname'., Ludovic Courtès, 2017/06/28
- 12/16: gexp: 'local-file' calls 'canonicalize-path' only in rare cases.,
Ludovic Courtès <=
- 14/16: download: 'built-in-builders*' relies on the functional cache., Ludovic Courtès, 2017/06/28
- 01/16: gnu: bootstrap: Move 'use-modules' forms to the beginning of build expressions., Ludovic Courtès, 2017/06/28
- 15/16: store: Add 'GUIX_PROFILING' support for the object cache., Ludovic Courtès, 2017/06/28
- 09/16: Use 'mapm' instead of 'sequence' + 'map'., Ludovic Courtès, 2017/06/28
- 05/16: packages: Turn 'bag->derivation' into a monadic procedure., Ludovic Courtès, 2017/06/28
- 11/16: packages: Turn 'cache!' into a single-value-return cache., Ludovic Courtès, 2017/06/28
- 06/16: store: Add a functional object cache and use it in 'lower-object'., Ludovic Courtès, 2017/06/28
- 10/16: gexp: 'imported-files' takes file-like objects., Ludovic Courtès, 2017/06/28
- 07/16: DRAFT gexp: Handle list conversion to <gexp-input> in the expanded code., Ludovic Courtès, 2017/06/28
- 16/16: packages: Core procedures are written in monadic style., Ludovic Courtès, 2017/06/28