aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-03-22 08:56:43 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-03-22 08:59:18 -0700
commitbd1d90d876c07dbbfac74f6a2b55d879843fc9cc (patch)
tree6d97e3f8bdf317df885d1b7b50edaed156bab38e /src
parent29b58a026814277d0bdbaaa7f3bc101710111b85 (diff)
downloadconsfigurator-bd1d90d876c07dbbfac74f6a2b55d879843fc9cc.tar.gz
rename :DEBIAN-SBCL -> :SBCL & use a property to install sbcl
Unconditionally calling apt was actually the only Debian-specific thing about the connection type. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src')
-rw-r--r--src/connection/sbcl.lisp (renamed from src/connection/debian-sbcl.lisp)16
-rw-r--r--src/connection/sudo.lisp4
-rw-r--r--src/data/asdf.lisp15
-rw-r--r--src/package.lisp8
4 files changed, 27 insertions, 16 deletions
diff --git a/src/connection/debian-sbcl.lisp b/src/connection/sbcl.lisp
index c5daa5e..4ed465c 100644
--- a/src/connection/debian-sbcl.lisp
+++ b/src/connection/sbcl.lisp
@@ -15,11 +15,21 @@
;;; You should have received a copy of the GNU General Public License
;;; along with this program. If not, see <http://www.gnu.org/licenses/>.
-(in-package :consfigurator.connection.debian-sbcl)
+(in-package :consfigurator.connection.sbcl)
(named-readtables:in-readtable :consfigurator)
-(defmethod establish-connection ((type (eql :debian-sbcl)) remaining &key)
- (mrun "which sbcl >/dev/null 2>&1 || apt-get -y install sbcl")
+(defprop sbcl-available :posix ()
+ (:check
+ (zerop (mrun :for-exit "command" "-v" "sbcl")))
+ (:apply
+ (typecase (class-of (get-hostattrs-car :os))
+ (os:debianlike
+ (ignoring-hostattrs (apt:installed "sbcl")))
+ (t
+ (failed-change "Do not know how to install SBCL on this OS.")))))
+
+(defmethod establish-connection ((type (eql :sbcl)) remaining &key)
+ (sbcl-available)
(request-lisp-systems)
(upload-all-prerequisite-data)
(inform t "Waiting for remote Lisp to exit, this may take some time ... ")
diff --git a/src/connection/sudo.lisp b/src/connection/sudo.lisp
index 3c7c633..5e2dbf9 100644
--- a/src/connection/sudo.lisp
+++ b/src/connection/sudo.lisp
@@ -34,8 +34,8 @@
;; passwords needed for establishing the remaining hops. Depending on how the
;; connection type feeds instructions to the remote Lisp image, this may
;; involve writing your sudo password to a file under ~/.cache on the machine
-;; which runs the remote Lisp image. At least :debian-sbcl avoids this by
-;; sending your password in on stdin.
+;; which runs the remote Lisp image. At least :sbcl avoids this by sending
+;; your password in on stdin.
;; TODO Let's require the user pass :PASSWD or :NOPASSWD to indicate whether
;; we'll query prerequisite data sources and always try to send a password on
diff --git a/src/data/asdf.lisp b/src/data/asdf.lisp
index 2d61c49..51ac344 100644
--- a/src/data/asdf.lisp
+++ b/src/data/asdf.lisp
@@ -21,14 +21,13 @@
;; could we have both :asdf-monolithic and :asdf-something_else where in the
;; latter we filter out the names of systems already known to be available on
;; the remote side, so those don't need to be uploaded? for example, the
-;; :debian-sbcl connection type can try to install them with apt on the remote
-;; side, then ask asdf for a concatenated source for everything excluding
-;; those. if asdf can't be asked to do that, maybe we can ask it to produce
-;; one file per system, and then we eliminate those we don't want and
-;; concatenate the result ourselves. maybe we can create a fake system object
-;; based on the real one, remove some deps from it according to a known
-;; mapping of systems to Debian package names, then ask asdf to concatenate
-;; that system
+;; :sbcl connection type can try to install them with apt on the remote side,
+;; then ask asdf for a concatenated source for everything excluding those. if
+;; asdf can't be asked to do that, maybe we can ask it to produce one file per
+;; system, and then we eliminate those we don't want and concatenate the
+;; result ourselves. maybe we can create a fake system object based on the
+;; real one, remove some deps from it according to a known mapping of systems
+;; to Debian package names, then ask asdf to concatenate that system
(defmethod register-data-source ((type (eql :asdf)) &key)
(cons #'asdf-data-source-check #'get-path-to-concatenated-system))
diff --git a/src/package.lisp b/src/package.lisp
index 856399d..b8fad64 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -198,9 +198,6 @@
(:use #:cl #:consfigurator #:alexandria)
(:export #:local-connection))
-(defpackage :consfigurator.connection.debian-sbcl
- (:use #:cl #:consfigurator))
-
(defpackage :consfigurator.connection.chroot
(:use #:cl #:consfigurator #:cffi))
@@ -272,6 +269,11 @@
#:uses-local-cacher
#:standard-sources.list))
+(defpackage :consfigurator.connection.sbcl
+ (:use #:cl #:consfigurator)
+ (:local-nicknames (#:os #:consfigurator.property.os)
+ (#:apt #:consfigurator.property.apt)))
+
(defpackage :consfigurator.property.user
(:use #:cl #:consfigurator)
(:local-nicknames (#:os #:consfigurator.property.os))