aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArun Isaac2024-09-13 05:55:40 +0100
committerArun Isaac2024-09-13 05:55:40 +0100
commit5f2f55e1ea609da53dd214ae54c90efeb45730be (patch)
treea579837ae3d576989db3d36e98210b706355f888
parent66f6a98fe2c8ef35bfa62284ac0979be6f20c052 (diff)
downloadravanan-5f2f55e1ea609da53dd214ae54c90efeb45730be.tar.gz
ravanan-5f2f55e1ea609da53dd214ae54c90efeb45730be.tar.lz
ravanan-5f2f55e1ea609da53dd214ae54c90efeb45730be.zip
command-line-tool: Remove unused collect-input-files function.
* ravanan/command-line-tool.scm (collect-input-files): Delete function.
-rw-r--r--ravanan/command-line-tool.scm51
1 files changed, 0 insertions, 51 deletions
diff --git a/ravanan/command-line-tool.scm b/ravanan/command-line-tool.scm
index 7a50ee3..b0cb28d 100644
--- a/ravanan/command-line-tool.scm
+++ b/ravanan/command-line-tool.scm
@@ -313,57 +313,6 @@ G-expressions are inserted."
;; If location is an URI, parse the URI and return the path part.
(uri-path (string->uri location))))
-(define (collect-input-files inputs formal-inputs store)
- "Traverse @var{inputs} and @var{formal-inputs} recursively, intern any files
-found into the @var{store} and return a list of all the @code{File} type
-objects.
-
-The returned @code{File} type objects are updated with @code{basename},
-@code{checksum} and @code{size} fields, and store-interned paths in the
-@code{location} and @code{path} fields. The @code{basename} field contains the
-basename of the original path, and not the store-interned path."
- (let collect ((inputs (map (lambda (formal-input)
- (let ((id (assoc-ref formal-input "id")))
- (or (assoc-ref inputs id)
- (assoc-ref formal-input "default")
- 'null)))
- formal-inputs))
- (types (map (lambda (formal-input)
- (let ((id (assoc-ref formal-input "type")))
- (or (assoc-ref formal-input "type")
- (user-error "Type of input ~a not specified"
- id))))
- formal-inputs)))
- (append-map (lambda (input type-tree)
- ;; Check type.
- (let* ((type (formal-parameter-type type-tree))
- (matched-type (match-type input type)))
- (unless matched-type
- (error input "Type mismatch" input type))
- (cond
- ;; Recurse over array types.
- ;; TODO: Implement record and enum types.
- ((array-type? matched-type)
- (collect (vector->list input)
- (make-list (vector-length input)
- (assoc-ref type-tree "items"))))
- ((eq? matched-type 'File)
- (let* ((location (assoc-ref input "location"))
- (path (or (and location
- (location->path location))
- (assoc-ref input "path")))
- (interned-path (intern-file path store)))
- (list (assoc-set input
- (cons "location" interned-path)
- (cons "path" interned-path)
- (cons "basename" (basename path))
- (cons "checksum" (checksum path))
- (cons "size"
- (stat:size (stat path)))))))
- (else (list)))))
- inputs
- types)))
-
(define (resolve-inputs inputs formal-inputs store)
"Traverse @var{inputs} and @var{formal-inputs} recursively, intern any
files found into the @var{store} and return a tree of the fully