self: Optimize 'file-append*' for 'local-file?'.
* guix/self.scm (file-append*): Add 'local-file?' case. * guix/gexp.scm (local-file-select?): Export.
This commit is contained in:
parent
8c23d7a15e
commit
f408d8d636
@ -51,6 +51,7 @@
|
|||||||
local-file-absolute-file-name
|
local-file-absolute-file-name
|
||||||
local-file-name
|
local-file-name
|
||||||
local-file-recursive?
|
local-file-recursive?
|
||||||
|
local-file-select?
|
||||||
|
|
||||||
plain-file
|
plain-file
|
||||||
plain-file?
|
plain-file?
|
||||||
|
@ -213,7 +213,15 @@ record with the new file name."
|
|||||||
;; itself.
|
;; itself.
|
||||||
(local-file (string-append item "/" file)
|
(local-file (string-append item "/" file)
|
||||||
#:recursive? recursive?))
|
#: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,
|
;; In this case, anything that refers to the result also depends on ITEM,
|
||||||
;; which isn't great.
|
;; which isn't great.
|
||||||
|
Loading…
Reference in New Issue
Block a user