Commit 5437fd25 authored by Marco Antoniotti's avatar Marco Antoniotti

Added a few convenience functions.

parent 525870e9
......@@ -10,7 +10,10 @@
"USER-COMMON-LISP-DATA-DIRECTORY"
"USER-CL-DATA-FOLDER"
"APP-OR-LIBRARY-DATA-FOLDER"
"APP-OR-LIBRARY-DATA-FOLDERS"
"KNOWN-APPS-OR-LIBRARIES-DATA"
"ENSURE-APP-OR-LIBRARY-DATA-FOLDER"
"RESET-APP-OR-LIBRARY-DATA-FOLDER"
))
......
......@@ -56,6 +56,19 @@
(and (probe-file a-or-l-dd-pathname) t))))
(defun app-or-library-data-folders ()
"Returns a list of the folder pathnames present in the CL data folder."
(directory (user-common-lisp-data-directory)))
(defun known-apps-or-libraries-data ()
"Returns a list of known apps or libraries listed in the CL data folder."
(mapcar #'(lambda (aldf)
(declare (type pathname aldf))
(first (last (pathname-directory aldf))))
(app-or-library-data-folders)))
(defun ensure-app-or-library-data-folder (app-or-library-name
&key
version-name
......@@ -76,6 +89,17 @@
))
(defun reset-app-or-data-folder (app-or-library-name &optional abort-if-non-empty)
(declare (type string app-or-library-name)
(type boolean abort-if-non-empty)
)
(when (string/= "" app-or-library-name)
(let ((app-lib-data-folder (app-or-library-data-folder app-or-library-name)))
(dolist (f (directory app-lib-data-folder) t)
(delete-file f)
))))
;;;; These will go in the 'impl-dependent' folder.
#-sbcl
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment