From cbe56ebc323afa15d5aa2e1f918e01d660c6f322 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 2 Apr 2022 12:48:47 -0700 Subject: DEFAULT-DEPLOYMENT: leave unbound when not supplied Signed-off-by: Sean Whitton --- src/deployment.lisp | 10 ++-------- src/host.lisp | 14 ++++++++------ 2 files changed, 10 insertions(+), 14 deletions(-) diff --git a/src/deployment.lisp b/src/deployment.lisp index 3a3d404..09fecd0 100644 --- a/src/deployment.lisp +++ b/src/deployment.lisp @@ -199,17 +199,11 @@ You can then eval (NAME) to execute this deployment." (defun hostdeploy* (host &optional additional-properties) "Like DEPLOY*, but use the host's default deployment." - (deploy* (or (host-deployment host) - (simple-program-error "Host has no default deployment")) - host - additional-properties)) + (deploy* (host-deployment host) host additional-properties)) (defun hostdeploy-these* (host properties) "Like DEPLOY-THESE*, but use the host's default deployment." - (deploy-these* (or (host-deployment host) - (simple-program-error "Host has no default deployment")) - host - properties)) + (deploy-these* (host-deployment host) host properties)) (defmacro hostdeploy (host &body additional-properties) "Like DEPLOY, but use the host's default deployment." diff --git a/src/host.lisp b/src/host.lisp index 979ab8c..6a638e6 100644 --- a/src/host.lisp +++ b/src/host.lisp @@ -30,7 +30,6 @@ :reader host-propspec :documentation "Propspec of the properties to be applied to the host.") (default-deployment - :initform nil :initarg :deploy :reader host-deployment :documentation @@ -100,9 +99,11 @@ values higher up the call stack.")) (propappattrs (eval-propspec (host-propspec *host*))) *host*)) -(defun make-host (&key hostattrs (propspec (make-propspec)) deploy) - (make-instance 'unpreprocessed-host - :hostattrs hostattrs :propspec propspec :deploy deploy)) +(defun make-host + (&key hostattrs (propspec (make-propspec)) (deploy nil deploy-supplied-p)) + (apply #'make-instance 'unpreprocessed-host + :hostattrs hostattrs :propspec propspec + (and deploy-supplied-p `(:deploy ,deploy)))) (defun make-child-host (&key hostattrs propspec) "Make a host object to represent a chroot, container or the like. @@ -148,7 +149,8 @@ Called by properties which set up such subhosts, like CHROOT:OS-BOOTSTRAPPED." (propspec-systems (host-propspec host))) :propspec (propspec-props propspec)))) -(defmacro defhost (hostname (&key deploy) &body properties) +(defmacro defhost + (hostname (&key (deploy nil deploy-supplied-p)) &body properties) "Define a host with hostname HOSTNAME and properties PROPERTIES. HOSTNAME can be a string or a symbol. In either case, the host will get a static informational property with its hostname as a string, and the symbol @@ -187,7 +189,7 @@ entries." (make-host :hostattrs ',attrs :propspec (make-propspec :propspec (props seqprops ,@properties)) - :deploy ',deploy) + ,@(and deploy-supplied-p `(:deploy ',deploy))) ,(car (getf attrs :desc))) ,@(and deploy `((defdeploy ,hostname-sym (,deploy ,hostname-sym))))))) -- cgit v1.2.3