diff options
author | Sean Whitton <spwhitton@spwhitton.name> | 2021-09-05 15:38:46 -0700 |
---|---|---|
committer | Sean Whitton <spwhitton@spwhitton.name> | 2021-09-08 13:09:37 -0700 |
commit | 210a2d70570792f8fac53960557232de910bff37 (patch) | |
tree | 4060cbe2298a02426b2df7c31507512c948a6c1e /src/property | |
parent | a41a42f86145909bafa1d7ce75a2ca3a9944e7fa (diff) | |
download | consfigurator-210a2d70570792f8fac53960557232de910bff37.tar.gz |
add dep on Anaphora and use APROG1, ALET & AAND in various places
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property')
-rw-r--r-- | src/property/crypttab.lisp | 5 | ||||
-rw-r--r-- | src/property/disk.lisp | 7 | ||||
-rw-r--r-- | src/property/firewalld.lisp | 13 | ||||
-rw-r--r-- | src/property/fstab.lisp | 6 |
4 files changed, 13 insertions, 18 deletions
diff --git a/src/property/crypttab.lisp b/src/property/crypttab.lisp index a24ac26..28bcaf7 100644 --- a/src/property/crypttab.lisp +++ b/src/property/crypttab.lisp @@ -70,9 +70,8 @@ except that if the second field of the existing entry is not \"none\" and the corresponding member of ENTRIES is \"none\" or \"PLACEHOLDER\", use the existing field value." (:desc - (let ((devices - (loop for entry in entries collect (car (split-string entry))))) - (format nil "crypttab entr~@P for ~{~A~^, ~}" (length devices) devices))) + (alet (loop for entry in entries collect (car (split-string entry))) + (format nil "crypttab entr~@P for ~{~A~^, ~}" (length it) it))) (:apply (file:update-unix-table #P"/etc/crypttab" 1 0 entries))) (defprop entries-for-opened-volumes :posix () diff --git a/src/property/disk.lisp b/src/property/disk.lisp index 3fa97ee..04393ce 100644 --- a/src/property/disk.lisp +++ b/src/property/disk.lisp @@ -925,10 +925,9 @@ filesystems will be incrementally updated when other properties change." if (and physical-disk-p (not found) (slot-boundp volume 'volume-contents)) do (setq found t) - and collect (let ((copy (copy-volume-and-contents volume))) - (change-class copy 'raw-disk-image) - (setf (image-file copy) image-pathname) - copy) + and collect (aprog1 (copy-volume-and-contents volume) + (change-class it 'raw-disk-image) + (setf (image-file it) image-pathname)) else unless physical-disk-p collect volume finally diff --git a/src/property/firewalld.lisp b/src/property/firewalld.lisp index a39b22c..f4d7a25 100644 --- a/src/property/firewalld.lisp +++ b/src/property/firewalld.lisp @@ -37,13 +37,12 @@ (flet ((run () (let ((output (mrun "firewall-cmd" args))) (and warning (search warning output) :no-change)))) - (let ((result (if file - (with-change-if-changes-file - ((merge-pathnames file #P"/etc/firewalld/")) (run)) - (run)))) - (unless (eql result :no-change) - (mrun "firewall-cmd" "--reload")) - result)))) + (aprog1 (if file + (with-change-if-changes-file + ((merge-pathnames file #P"/etc/firewalld/")) (run)) + (run)) + (unless (eql it :no-change) + (mrun "firewall-cmd" "--reload")))))) ;;;; Setting contents of XML configuration files diff --git a/src/property/fstab.lisp b/src/property/fstab.lisp index a4eaf98..5a8feef 100644 --- a/src/property/fstab.lisp +++ b/src/property/fstab.lisp @@ -85,10 +85,8 @@ member of ENTRIES is \"none\", or \"PLACEHOLDER\", use the existing field value. This makes it easy to update mount options without having to specify the partition or filesystem UUID in your consfig." - (:desc - (let ((mount-points (mapcar (compose #'cadr #'words) entries))) - (format nil "fstab entr~@P for ~{~A~^, ~}" - (length mount-points) mount-points))) + (:desc (alet (mapcar (compose #'cadr #'words) entries) + (format nil "fstab entr~@P for ~{~A~^, ~}" (length it) it))) (:apply (file:update-unix-table #P"/etc/fstab" 0 1 entries))) (defprop entries-for-volumes :posix (&optional volumes) |