mirror of
https://git.savannah.gnu.org/git/guix.git
synced 2026-05-28 03:51:53 +02:00
utils: Add 'install-file'.
* guix/build/utils.scm (install-file): New procedure.
This commit is contained in:
@@ -43,6 +43,7 @@
|
|||||||
ar-file?
|
ar-file?
|
||||||
with-directory-excursion
|
with-directory-excursion
|
||||||
mkdir-p
|
mkdir-p
|
||||||
|
install-file
|
||||||
copy-recursively
|
copy-recursively
|
||||||
delete-file-recursively
|
delete-file-recursively
|
||||||
file-name-predicate
|
file-name-predicate
|
||||||
@@ -197,6 +198,12 @@ with the bytes in HEADER, a bytevector."
|
|||||||
(apply throw args))))))
|
(apply throw args))))))
|
||||||
(() #t))))
|
(() #t))))
|
||||||
|
|
||||||
|
(define (install-file file directory)
|
||||||
|
"Create DIRECTORY if it does not exist and copy FILE in there under the same
|
||||||
|
name."
|
||||||
|
(mkdir-p directory)
|
||||||
|
(copy-file file (string-append directory "/" (basename file))))
|
||||||
|
|
||||||
(define* (copy-recursively source destination
|
(define* (copy-recursively source destination
|
||||||
#:key
|
#:key
|
||||||
(log (current-output-port))
|
(log (current-output-port))
|
||||||
|
|||||||
Reference in New Issue
Block a user