From 4cc2ed98cf7837e042ad4234c91fe730259a7170 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ludovic=20Court=C3=A8s?= Date: Fri, 28 Aug 2015 22:07:05 +0200 Subject: [PATCH] utils: Add 'install-file'. * guix/build/utils.scm (install-file): New procedure. --- guix/build/utils.scm | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/guix/build/utils.scm b/guix/build/utils.scm index 676a0120e3..16406930b5 100644 --- a/guix/build/utils.scm +++ b/guix/build/utils.scm @@ -43,6 +43,7 @@ (define-module (guix build utils) ar-file? with-directory-excursion mkdir-p + install-file copy-recursively delete-file-recursively file-name-predicate @@ -197,6 +198,12 @@ (define not-slash (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))