summaryrefslogtreecommitdiff
path: root/guix/self.scm
diff options
context:
space:
mode:
authorLudovic Courtès <ludo@gnu.org>2020-05-25 17:33:04 +0200
committerLudovic Courtès <ludo@gnu.org>2020-05-25 23:00:30 +0200
commitf408d8d636ac24d576e9ee91a6c823e0874386ef (patch)
tree6ba65dbcb1ca9d4e0b649b670f4c18a3b2fb1b67 /guix/self.scm
parent8c23d7a15e90481f0b4ab2ba9bd178d68e7affaa (diff)
downloadguix-f408d8d636ac24d576e9ee91a6c823e0874386ef.tar.gz
guix-f408d8d636ac24d576e9ee91a6c823e0874386ef.tar.xz
self: Optimize 'file-append*' for 'local-file?'.
* guix/self.scm (file-append*): Add 'local-file?' case. * guix/gexp.scm (local-file-select?): Export.
Diffstat (limited to 'guix/self.scm')
-rw-r--r--guix/self.scm10
1 files changed, 9 insertions, 1 deletions
diff --git a/guix/self.scm b/guix/self.scm
index a9568049b2..60fe6e6b01 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.