commit 46fc13a5e3d6b0c1602765dd0927cd4764a9c098 Spenser Truex <web@spensertruex.com> 2019-11-02 22:56:57 -0700 Better support for different cores. Use symbols.
CONFIG-QUICKLISP.lisp | 7 ++----- README.md | 4 ++++ code/install.lisp | 13 ++++++------- code/save.lisp | 14 +++++++------- 4 files changed, 19 insertions(+), 19 deletions(-)
diff --git a/CONFIG-QUICKLISP.lisp b/CONFIG-QUICKLISP.lisp index 99749b0..d23baf8 100644 --- a/CONFIG-QUICKLISP.lisp +++ b/CONFIG-QUICKLISP.lisp @@ -1,7 +1,4 @@ (in-package #:sbcl-librarian) (defparameter *quicklisp-packages* - '( - ;; Example: - ;; alexandria uiop cl-ppcre - ) - "User configured Packages for Quicklisp. Edit this!") + '() + "user configured Packages for Quicklisp. Edit this!") diff --git a/README.md b/README.md index c31b04e..dad35a9 100644 --- a/README.md +++ b/README.md @@ -26,6 +26,10 @@ We need to know which packages are needed, and whether they are from quicklisp. 2. Load the package: `(asdf:load-system :sbcl-librarian)` 3. Install: `(sbcl-librarian:install)`. SBCL will save and die. +By default sbcl-librarian will try to overwrite your installed core file. This +may require root access on your system; alternatively, try +`(sbcl-librarian:install :core "path-to-your-core")` for a different core. + ## Updating packages `(sbcl-librarian:update)`. SBCL will save and die again. diff --git a/code/install.lisp b/code/install.lisp index 16975d6..42e51a5 100644 --- a/code/install.lisp +++ b/code/install.lisp @@ -64,12 +64,11 @@ (prin1 '(sbcl-librarian:update) sbclrc) (format sbclrc "~%")))) -(defun backup-core (core &optional (backup #P".core.bak")) - (let ((backup (merge-pathnames backup core))) - (copy-file core backup (* 1024 1024)))) +(defun backup-core (core backup) + (copy-file core backup (* 1024 1024))) -(defun install (&optional (sbclrc *sbclrc-path*) (core *core-path*)) - (if (not (installedp sbclrc)) - (write-to-init-file sbclrc core)) - (backup-core core) +(defun install (&key (sbclrc *sbclrc-path*) (core *core-path*)) + (when (not (installedp sbclrc)) + (write-to-init-file sbclrc core)) + (backup-core core (merge-pathnames #P".core.bak" sbclrc)) (update core)) diff --git a/code/save.lisp b/code/save.lisp index 0d74463..7f405cf 100644 --- a/code/save.lisp +++ b/code/save.lisp @@ -1,15 +1,15 @@ (in-package #:sbcl-librarian) -(defun update (&optional (core-path *core-path*)) +(defun update (&optional (core *core-path*)) (load-configs) - (save core-path)) + (save core)) -(defun save (&optional (core-path *core-path*)) +(defun save (&optional (core *core-path*)) ;; Should ensure that this is friendly. ~ is not allowed, does it actually ;; exist, etc. (sb-ext:save-lisp-and-die (asdf/pathname:ensure-absolute-pathname - core-path))) + core))) (defun load-configs () (mapcar #'(lambda (fn pkg) @@ -18,10 +18,10 @@ (require pkg))) (list #'ql:quickload #'asdf:load-system) (list (verify-ql *quicklisp-packages*) - (verify-asdf *asdf-packages*)))) + (verify-asdf *asdf-packages*)))) -(defun verify-ql (packages) packages) -(defun verify-asdf (packages) packages) +(defun verify-ql (packages) (macpar #'symbol-name packages)) +(defun verify-asdf (packages) (mapcar #'symbol-name packages)) ;;; Would be nice to have an interface here with continuations, friendly output ;;; and warnings, etc.