[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
04/08: self: Optimize 'file-append*' for 'local-file?'.
From: |
guix-commits |
Subject: |
04/08: self: Optimize 'file-append*' for 'local-file?'. |
Date: |
Mon, 25 May 2020 17:40:53 -0400 (EDT) |
civodul pushed a commit to branch master
in repository guix.
commit f408d8d636ac24d576e9ee91a6c823e0874386ef
Author: Ludovic Courtès <address@hidden>
AuthorDate: Mon May 25 17:33:04 2020 +0200
self: Optimize 'file-append*' for 'local-file?'.
* guix/self.scm (file-append*): Add 'local-file?' case.
* guix/gexp.scm (local-file-select?): Export.
---
guix/gexp.scm | 1 +
guix/self.scm | 10 +++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/guix/gexp.scm b/guix/gexp.scm
index 9e193c7..510a1d5 100644
--- a/guix/gexp.scm
+++ b/guix/gexp.scm
@@ -51,6 +51,7 @@
local-file-absolute-file-name
local-file-name
local-file-recursive?
+ local-file-select?
plain-file
plain-file?
diff --git a/guix/self.scm b/guix/self.scm
index a956804..60fe6e6 100644
--- a/guix/self.scm
+++ b/guix/self.scm
@@ -213,7 +213,15 @@ record with the new file name."
;; itself.
(local-file (string-append item "/" file)
#:recursive? recursive?))
- ;; TODO: Add 'local-file?' case.
+ ((? local-file? base)
+ ;; Likewise, but with a <local-file>.
+ (if (local-file-recursive? base)
+ (local-file (string-append (local-file-absolute-file-name base)
+ "/" file)
+ (basename file)
+ #:recursive? recursive?
+ #:select? (local-file-select? base))
+ (file-append base file)))
(_
;; In this case, anything that refers to the result also depends on ITEM,
;; which isn't great.
- branch master updated (6115ab1 -> a1a3bd5), guix-commits, 2020/05/25
- 01/08: tests: Hide quoted (define-module ...) form from Geiser., guix-commits, 2020/05/25
- 05/08: gnu: qhull: Update to 2019.1, guix-commits, 2020/05/25
- 03/08: doc: Remove one use of 'file-append*'., guix-commits, 2020/05/25
- 02/08: gexp: Fix expansion for (file-append (local-file ...) ...)., guix-commits, 2020/05/25
- 07/08: compile: Do not optimize "gnu/tests/*"., guix-commits, 2020/05/25
- 06/08: gexp: The result of 'imported-files/derivation' is non-substitutable., guix-commits, 2020/05/25
- 08/08: maint: 'authenticate' depends on a couple of .go files., guix-commits, 2020/05/25
- 04/08: self: Optimize 'file-append*' for 'local-file?'.,
guix-commits <=