From cf7cf446cd90b7e543c970878b3a92b107826ca6 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Thu, 24 Jun 2021 11:36:28 -0700 Subject: Let's Encrypt: fix looking for changed files & flatten DOMAINS Signed-off-by: Sean Whitton --- src/property.lisp | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'src/property.lisp') 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) -- cgit v1.2.3