~ruther/guix-local

4cc2ed98cf7837e042ad4234c91fe730259a7170 — Ludovic Courtès 10 years ago 90d891f
utils: Add 'install-file'.

* guix/build/utils.scm (install-file): New procedure.
1 files changed, 7 insertions(+), 0 deletions(-)

M guix/build/utils.scm
M guix/build/utils.scm => guix/build/utils.scm +7 -0
@@ 43,6 43,7 @@
            ar-file?
            with-directory-excursion
            mkdir-p
            install-file
            copy-recursively
            delete-file-recursively
            file-name-predicate


@@ 197,6 198,12 @@ with the bytes in HEADER, a bytevector."
                 (apply throw args))))))
      (() #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
                           #:key
                           (log (current-output-port))