diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-20 14:03:34 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-03-20 14:03:34 -0700 |
commit | 847520da96836aaff641c4c82b87511fc65770c9 (patch) | |
tree | 18cfce3ea44587c4bd2d1962d6985a4a40940f30 /src/host.lisp | |
parent | d39ccc1403762b19b9966493342867b115294a2e (diff) | |
download | consfigurator-847520da96836aaff641c4c82b87511fc65770c9.tar.gz |
add and export WITH-PRESERVE-HOSTATTRS
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/host.lisp')
-rw-r--r-- | src/host.lisp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/src/host.lisp b/src/host.lisp index 1eae634..b58c023 100644 --- a/src/host.lisp +++ b/src/host.lisp @@ -48,6 +48,14 @@ :hostattrs (copy-list (hostattrs host)) :propspec (host-propspec host))) +(defmacro with-preserve-hostattrs (&body forms) + "Evaluate FORMS then throw away any newly added hostattrs. +Useful in property combinators when you need to run some :HOSTATTRS +subroutines but ignore any new hostattrs they may push. Shouldn't be used in +properties." + `(let ((*host* (shallow-copy-host *host*))) + ,@forms)) + (defgeneric preprocess-host (host) (:documentation "Convert a host into a fresh preprocessed host if necessary, and |