diff options
author | Ludovic Courtès <ludo@gnu.org> | 2018-11-06 09:35:06 +0100 |
---|---|---|
committer | Ludovic Courtès <ludo@gnu.org> | 2018-11-06 17:00:02 +0100 |
commit | 6cf502d164a47fa38e2fa63972409e97c06c288c (patch) | |
tree | 67e69022ab9127a131980bfad17d5eb8ea2af917 | |
parent | 3527f600b5ca290f1164a3018ef8f168e940127e (diff) | |
download | guix-6cf502d164a47fa38e2fa63972409e97c06c288c.tar guix-6cf502d164a47fa38e2fa63972409e97c06c288c.tar.gz |
self: Rename 'sub-directory' to 'file-append*'.
* guix/self.scm (sub-directory): Rename to...
(file-append*): ... this. Add #:recursive? parameter and pass it to
'local-file'.
(locale-data, info-manual, compiled-guix): Adjust accordingly.
-rw-r--r-- | guix/self.scm | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/guix/self.scm b/guix/self.scm index 4548e6c044..43223972c6 100644 --- a/guix/self.scm +++ b/guix/self.scm @@ -206,21 +206,22 @@ list of file-name/file-like objects suitable as inputs to 'imported-files'." (local-file file #:recursive? #t))) (find-files (string-append directory "/" sub-directory) pred))) -(define* (sub-directory item sub-directory) - "Return SUB-DIRECTORY within ITEM, which may be a file name or a file-like -object." +(define* (file-append* item file #:key (recursive? #t)) + "Return FILE within ITEM, which may be a file name or a file-like object. +When ITEM is a plain file name (a string), simply return a 'local-file' +record with the new file name." (match item ((? string?) ;; This is the optimal case: we return a new "source". Thus, a ;; derivation that depends on this sub-directory does not depend on ITEM ;; itself. - (local-file (string-append item "/" sub-directory) - #:recursive? #t)) + (local-file (string-append item "/" file) + #:recursive? recursive?)) ;; TODO: Add 'local-file?' case. (_ ;; In this case, anything that refers to the result also depends on ITEM, ;; which isn't great. - (file-append item "/" sub-directory)))) + (file-append item "/" file)))) (define* (locale-data source domain #:optional (directory domain)) @@ -238,7 +239,7 @@ DOMAIN, a gettext domain." (ice-9 match) (ice-9 ftw)) (define po-directory - #+(sub-directory source (string-append "po/" directory))) + #+(file-append* source (string-append "po/" directory))) (define (compile language) (let ((gmo (string-append #$output "/" language "/LC_MESSAGES/" @@ -273,10 +274,10 @@ DOMAIN, a gettext domain." 'graphviz)) (define documentation - (sub-directory source "doc")) + (file-append* source "doc")) (define examples - (sub-directory source "gnu/system/examples")) + (file-append* source "gnu/system/examples")) (define build (with-imported-modules '((guix build utils)) @@ -674,8 +675,8 @@ assumed to be part of MODULES." 'guix-daemon) #:info (info-manual source) - #:substitute-keys (sub-directory source - "etc/substitutes") + #:substitute-keys (file-append* source + "etc/substitutes") #:guile-version guile-version))) ((= 0 pull-version) ;; Legacy 'guix pull': return the .scm and .go files as one |