aboutsummaryrefslogtreecommitdiff
path: root/src/property.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-24 11:36:28 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-25 16:10:56 -0700
commitcf7cf446cd90b7e543c970878b3a92b107826ca6 (patch)
tree7bb3c65778260afce173fc2aaf65de9ba7f16592 /src/property.lisp
parent4b6dc7906d48cd609367a83b051310f4967d5098 (diff)
downloadconsfigurator-cf7cf446cd90b7e543c970878b3a92b107826ca6.tar.gz
Let's Encrypt: fix looking for changed files & flatten DOMAINS
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r--src/property.lisp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/property.lisp b/src/property.lisp
index 3f0b962..d23fd99 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -599,6 +599,19 @@ changes in properties which will change the file but not the output of `ls
(and ,before (equal ,before (ls-cksum ,file))))
:no-change result))))
+(defmacro with-change-if-changes-files ((&rest files) &body forms)
+ "Execute FORMS and yield :NO-CHANGE if none of FILES change.
+See WITH-CHANGE-IF-CHANGES-FILE docstring regarding the sense of 'change'."
+ (with-gensyms (filesg beforeg)
+ `(let* ((,filesg (list ,@files))
+ (,beforeg (mapcar #'ls-cksum ,filesg))
+ (result (progn ,@forms)))
+ (if (or (eql result :no-change)
+ (loop for file in ,filesg and before in ,beforeg
+ always before
+ always (equal before (ls-cksum file))))
+ :no-change result))))
+
(defmacro with-change-if-changes-file-content ((file) &body forms)
"Execute FORMS and yield :NO-CHANGE if FILE has the same content afterwards."
(with-gensyms (before)