aboutsummaryrefslogtreecommitdiff
path: root/src/property.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-05-20 23:05:25 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-05-20 23:13:18 -0700
commitce167652a1839426a786cc35c4cc85948fee2a02 (patch)
treee5c2cc32a16774be9c7a82804fde48eda2a92902 /src/property.lisp
parent55ae0b8942f44becf2a8fda50c03c085e4da7cc3 (diff)
downloadconsfigurator-ce167652a1839426a786cc35c4cc85948fee2a02.tar.gz
FILE:DATA-UPLOADED, FILE:SECRET-UPLOADED: use MAYBE-WRITEFILE-DATA
This avoids writing the file every deploy, even when unchanged. Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property.lisp')
-rw-r--r--src/property.lisp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/property.lisp b/src/property.lisp
index cf97e58..cf213b8 100644
--- a/src/property.lisp
+++ b/src/property.lisp
@@ -527,13 +527,13 @@ PATH already has the specified CONTENT and MODE."
"Cannot apply :LISP properties using a POSIX-type connection")))
(defun cksum (file)
- (ignore-errors (parse-integer (car (split-string (run "cksum" file))))))
+ (parse-integer (car (split-string (run "cksum" file)))))
;; this is a safe parse of ls(1) output given its POSIX specification
(defun ls-cksum (file)
(let ((ls (ignore-errors
(split-string (run :env '(:LOCALE "C") "ls" "-dlL" file))))
- (cksum (cksum file)))
+ (cksum (ignore-errors (cksum file))))
(when (and ls cksum)
(list* (car ls) cksum (subseq ls 2 8)))))
@@ -553,7 +553,7 @@ changes in properties which will change the file but not the output of `ls
(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)
- `(let* ((,before (cksum ,file))
+ `(let* ((,before (ignore-errors (cksum ,file)))
(result (progn ,@forms)))
(if (and ,before (eql ,before (cksum ,file)))
:no-change result))))