aboutsummaryrefslogtreecommitdiff
path: root/src/property/chroot.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-09-16 18:23:55 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-10-23 10:51:30 -0700
commit446b8f4a8ef78cb4605cfb551255bb455be411f0 (patch)
tree0baa5401d38cc7144a750852bb7ba7aebe3d0670 /src/property/chroot.lisp
parentd8f12a2c350ad788e1c9ce532f42460273990424 (diff)
downloadconsfigurator-446b8f4a8ef78cb4605cfb551255bb455be411f0.tar.gz
install system deps by searching for package managers on PATH
With this change we handle the situation in which we don't know the OS of a host on which we need to install system packages more cleanly than before. Also rely on the new PACKAGE:INSTALLED to install the OS bootstrapper in INSTALLER:CLEANLY-INSTALLED-ONCE. This allows us to simplify usage of the property by replacing the ORIGINAL-OS argument with ORIGINAL-OS-ARCHITECTURE. Making this change does mean that we now have two ways to specify the different names a package has on different OSs: (i) something like OS:ETYPECASE where each branch applies a property which invokes an OS-specific package manager; and (ii) the plists supplied to PACKAGE:INSTALLED. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/chroot.lisp')
-rw-r--r--src/property/chroot.lisp19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/property/chroot.lisp b/src/property/chroot.lisp
index 3cfe527..78ac0a3 100644
--- a/src/property/chroot.lisp
+++ b/src/property/chroot.lisp
@@ -53,26 +53,25 @@
(nconcf args (list apt.mirror)))
(apply #'run args))))
-(defprop %debootstrap-manually-installed :posix ()
+(defproplist %debootstrap-manually-installed :posix ()
+ ;; Accept any debootstrap we find on path to enable installing Debian on
+ ;; arbitrary unixes, where Consfigurator does not know how to install
+ ;; packages, but the user has manually installed debootstrap(8).
(:check (remote-executable-find "debootstrap"))
- (:apply
- (failed-change "Don't know how to install debootstrap(8) manually.")))
+ (package:installed nil '(:apt ("debootstrap"))))
(defpropspec %os-bootstrapper-installed :posix (host)
(:desc "OS bootstrapper installed")
(let ((host (preprocess-host host)))
`(os:host-etypecase ,host
(debian
- ;; Have %DEBOOTSTRAP-MANUALLY-INSTALLED like this to enable installing
- ;; Debian on arbitrary unixes, where Consfigurator doesn't know how to
- ;; install packages, but the user has manually ensured that
- ;; debootstrap(8) is on PATH. However, we don't have such an escape
- ;; hatch for the case where the architectures do not match because
- ;; ensuring that debootstrap(8) will be able to bootstrap a foreign
- ;; arch is more involved.
(os:typecase
(debianlike (apt:installed "debootstrap"))
(t (%debootstrap-manually-installed)))
+ ;; Don't have an escape hatch like the :CHECK subroutine of
+ ;; %DEBOOTSTRAP-MANUALLY-INSTALLED for the case where the
+ ;; architectures do not match because ensuring that debootstrap(8)
+ ;; will be able to bootstrap a foreign arch is more involved.
,@(and (not (call-with-os
#'os:supports-arch-p
(os:linux-architecture (get-hostattrs-car :os host))))