From cf3d71bf43729d153e9240bc1df70c2f62cd4e49 Mon Sep 17 00:00:00 2001 From: Arun Isaac Date: Tue, 22 Apr 2025 22:05:58 +0100 Subject: reader: Use canonicalize-file-value. * ravanan/reader.scm (normalize-input): Use canonicalize-file-value. --- ravanan/reader.scm | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/ravanan/reader.scm b/ravanan/reader.scm index a28ce94..a4e57c7 100644 --- a/ravanan/reader.scm +++ b/ravanan/reader.scm @@ -263,26 +263,7 @@ array of array of @code{File}s, etc. Else, return @code{#f}" input)) ((eq? (object-type input) 'File) - (let ((path (canonicalize-path (cond - ((assoc-ref input "location") => location->path) - (else (assoc-ref input "path")))))) - (maybe-assoc-set input - (cons "basename" (just (basename path))) - (cons "nameroot" (just (file-name-stem path))) - (cons "nameext" (just (file-name-extension path))) - (cons "size" (just (stat:size (stat path)))) - (cons "location" (just (uri->string (build-uri 'file #:path path)))) - (cons "path" (just path)) - ;; Compute the checksum, but only if it is not provided. If it is - ;; provided, trust that it is correct. This avoids costly (think hashing - ;; terabytes of data) hash computations causing a long delay before the - ;; workflow actually starts running. - (cons "checksum" (just (or (assoc-ref input "checksum") - (checksum path)))) - (cons "secondaryFiles" - (maybe-let* ((secondary-files (maybe-assoc-ref (just input) - "secondaryFiles"))) - (just (vector-map normalize-input secondary-files))))))) + (canonicalize-file-value input)) (else input))) (define (read-inputs inputs-file) -- cgit 1.4.1