diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-23 12:13:01 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-23 16:14:52 -0700 |
commit | a03c6cf89efa7dfe7054593e3d1cda44961850a4 (patch) | |
tree | 6a11c10c1f00497ad4288cfa6a7a58c8edee2cd8 /src/data.lisp | |
parent | 7276b811c2c0d817496094be9c51b89538c8eef7 (diff) | |
download | consfigurator-a03c6cf89efa7dfe7054593e3d1cda44961850a4.tar.gz |
add and export GET-HIGHEST-LOCAL-CACHED-PREREQUISITE-DATA
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/data.lisp')
-rw-r--r-- | src/data.lisp | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/data.lisp b/src/data.lisp index ffe905c..38d9267 100644 --- a/src/data.lisp +++ b/src/data.lisp @@ -344,6 +344,24 @@ process, where each entry is of the form (pathname-directory subdir)) (pathname-name file))))))) +(defun get-highest-local-cached-prerequisite-data (iden1 iden2) + "Get the highest version of prerequisite data identified by IDEN1 and IDEN2 +available in the local cache. + +This is exported for use by prerequisite data sources which work by generating +new files and need somewhere to store them. It should not be used by +properties, or data sources which return objects referencing existing files." + (when-let ((triple (car (remove-if-not + (lambda (c) + (and (string= (car c) iden1) + (string= (cadr c) iden2))) + (sort-prerequisite-data-cache + (get-local-cached-prerequisite-data)))))) + (make-instance 'file-data :file (apply #'local-data-pathname triple) + :iden1 (car triple) + :iden2 (cadr triple) + :version (caddr triple)))) + (defun get-remote-data-cache-dir () (ensure-directory-pathname (car |