aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/package.lisp1
-rw-r--r--src/property.lisp8
-rw-r--r--src/property/disk.lisp6
-rw-r--r--src/property/installer.lisp9
-rw-r--r--src/propspec.lisp19
5 files changed, 25 insertions, 18 deletions
diff --git a/src/package.lisp b/src/package.lisp
index bcdab16..d95506a 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -155,6 +155,7 @@
#:propspec-props
#:make-propspec
#:append-propspecs
+ #:propapp
;; combinator.lisp
#:define-function-property-combinator
diff --git a/src/property.lisp b/src/property.lisp
index 0a5768e..02871a3 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -349,6 +349,14 @@ It should be a pure function aside from retrieving hostattrs (as set by other
properties applied to the hosts to which the resulting property is applied,
not as set by the properties in the returned propspec).
+Macro property combinators should be usable in the normal way in the body, but
+some other macros commonly used in DEFHOST and DEFPROPLIST forms will not work
+as expected. In particular, the macros implementing dotted propapp notation
+expect to be used within unevaluated property application specification
+expressions and may not behave as expected in the body of DEFPROPSPEC. You
+can work around this particular limitation using the PROPAPP macro. See
+DISK:RAW-IMAGE-BUILT-FOR for an example of this technique.
+
You can usually use DEFPROPLIST instead of DEFPROPSPEC, which see."
;; This is implemented by effectively pushing a null pointer to the front of
;; the propapp's arguments at :PREPROCESS-time, calling the user's code with
diff --git a/src/property/disk.lisp b/src/property/disk.lisp
index 6136ca0..2603f12 100644
--- a/src/property/disk.lisp
+++ b/src/property/disk.lisp
@@ -813,10 +813,8 @@ filesystems will be incrementally updated when other properties change."
(unless found
(inapplicable-property
"Volumes list for host has no DISK:PHYSICAL-DISK with contents.")))))
- `(on-change (chroot:os-bootstrapped-for
- ,options ,chroot ,host
- ,(make-propspec :systems nil
- :propspec '(caches-cleaned)))
+ `(on-change ,(propapp (chroot:os-bootstrapped-for. options chroot host
+ (caches-cleaned)))
(%raw-image-created ,volumes :chroot ,chroot :rebuild ,rebuild)
(consfigurator.property.installer:chroot-installed-to-volumes
,host ,chroot ,volumes))))
diff --git a/src/property/installer.lisp b/src/property/installer.lisp
index ba7362f..80229a6 100644
--- a/src/property/installer.lisp
+++ b/src/property/installer.lisp
@@ -44,12 +44,9 @@ Also update the fstab and crypttab, and try to install a bootloader."
".target"))))
`(with-these-open-volumes (,volumes :mount-below ,target)
(%update-target-from-chroot ,chroot ,target)
- (chroot:deploys-these
- ,target ,host
- ,(make-propspec
- :systems nil
- :propspec
- '(os:etypecase
+ ,(propapp
+ (chroot:deploys-these. target host
+ (os:etypecase
(debianlike
(file:lacks-lines "/etc/fstab"
"# UNCONFIGURED FSTAB FOR BASE SYSTEM")
diff --git a/src/propspec.lisp b/src/propspec.lisp
index 16df661..525429b 100644
--- a/src/propspec.lisp
+++ b/src/propspec.lisp
@@ -243,15 +243,18 @@ unevaluated propspec are defined before that unevaluated propspec is
processed."
(cell-error-name condition)))))
-(defmacro props (combinator &rest forms)
- "Apply variadic COMBINATOR to FORMS and convert from an unevaluated property
-application specification expression to a property application specification
-expression."
+(defmacro propapp (form)
+ "Convert a single element of an unevaluated property application specification
+expression to a property application specification expression."
(flet ((evaluate (propapp)
`(list ',(car propapp) ,@(cdr propapp))))
- (handler-case
- (map-propspec-propapps #'evaluate (cons combinator forms) t)
+ (handler-case (map-propspec-propapps #'evaluate form t)
(ambiguous-propspec (c)
;; resignal with a more specific error message
- (error 'ambiguous-unevaluated-propspec
- :name (cell-error-name c))))))
+ (error 'ambiguous-unevaluated-propspec :name (cell-error-name c))))))
+
+(defmacro props (combinator &rest forms)
+ "Apply variadic COMBINATOR to FORMS and convert from an unevaluated property
+application specification expression to a property application specification
+expression."
+ `(propapp ,(cons combinator forms)))