From b981a5e783d491de1aad59abb5db8469b73c1080 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 16 Feb 2021 18:39:13 -0700 Subject: move code into an src/ subdir Signed-off-by: Sean Whitton --- src/data/asdf.lisp | 25 +++++++++++++++++++++++++ src/data/pgp.lisp | 8 ++++++++ 2 files changed, 33 insertions(+) create mode 100644 src/data/asdf.lisp create mode 100644 src/data/pgp.lisp (limited to 'src/data') diff --git a/src/data/asdf.lisp b/src/data/asdf.lisp new file mode 100644 index 0000000..bca2346 --- /dev/null +++ b/src/data/asdf.lisp @@ -0,0 +1,25 @@ +(in-package :consfigurator.data.asdf) + +(defmethod register-data-source ((type (eql :asdf)) &key) + (add-data-source #'asdf-data-source-check #'get-path-to-concatenated-system)) + +(defun asdf-data-source-check (iden1 system) + (and (string= iden1 "lisp-system") + (asdf:find-system system nil))) + +(Defun get-path-to-concatenated-system (iden1 system) + "Try to concatenate all the source code for SYSTEM, store it somewhere and +return the filename." + (let ((cache-dir (uiop:ensure-pathname-directory + (strcat (or (uiop:getenv "XDG_CACHE_HOME") + (strcat (uiop:getenv "HOME") "/.cache")) + "/consfigurator/systems"))) + (op 'asdf:monolithic-concatenate-source-op) + (co (asdf:find-component system nil))) + (ensure-directories-exist cache-dir) + (asdf:initialize-output-translations `(:output-translations + (t ,cache-dir) + :disable-cache + :ignore-inherited-configuration)) + (asdf:operate op co) + (list :file (asdf:output-file op co)))) diff --git a/src/data/pgp.lisp b/src/data/pgp.lisp new file mode 100644 index 0000000..c5affa5 --- /dev/null +++ b/src/data/pgp.lisp @@ -0,0 +1,8 @@ +(in-package :consfigurator.data.pgp) + +;;;; Simple PGP-encrypted file source of prerequisite data + +;; We provide an implementation of REGISTER-DATA-SOURCE and functions for the +;; user to call at the REPL to add pieces of data, see what's there, etc. (a +;; prerequisite data source which was some sort of external file-generating or +;; secrets storage database might not provide any functions for the REPL). -- cgit v1.2.3