From 006d3969bad1f84c0133a36ed9a623b59bd01c0e Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 3 Apr 2022 09:34:37 -0700 Subject: rename basic propapp accessors Signed-off-by: Sean Whitton --- src/property/container.lisp | 8 ++++---- src/property/disk.lisp | 6 +++--- src/property/installer.lisp | 6 +++--- src/property/libvirt.lisp | 6 +++--- src/property/lxc.lisp | 6 +++--- src/property/package.lisp | 10 +++++----- src/property/periodic.lisp | 4 ++-- src/property/postfix.lisp | 4 ++-- src/property/service.lisp | 9 +++++---- 9 files changed, 30 insertions(+), 29 deletions(-) (limited to 'src/property') diff --git a/src/property/container.lisp b/src/property/container.lisp index 454cd75..b23d3df 100644 --- a/src/property/container.lisp +++ b/src/property/container.lisp @@ -57,11 +57,11 @@ container type." always (member factor host-contained))) ,form :no-change)))) - (:retprop :type (propapptype propapp) + (:retprop :type (propapp-type propapp) :hostattrs (lambda-ignoring-args - (propappattrs propapp)) + (propapp-attrs propapp)) :apply (lambda-ignoring-args - (check-contained (propappapply propapp))) + (check-contained (apply-propapp propapp))) :unapply (lambda-ignoring-args - (check-contained (propappunapply propapp))) + (check-contained (unapply-propapp propapp))) :args (cdr propapp)))) diff --git a/src/property/disk.lisp b/src/property/disk.lisp index fd0df1b..52a9047 100644 --- a/src/property/disk.lisp +++ b/src/property/disk.lisp @@ -750,17 +750,17 @@ must not be modified." (define-function-property-combinator with-these-open-volumes* (volumes propapp &key (mount-below nil mount-below-supplied-p)) (:retprop - :type (propapptype propapp) + :type (propapp-type propapp) :hostattrs (lambda-ignoring-args (require-volumes-data volumes) - (propappattrs propapp)) + (propapp-attrs propapp)) :apply (lambda-ignoring-args (with-connattrs (:opened-volumes (apply #'open-volumes-and-contents `(,volumes ,@(and mount-below-supplied-p `(:mount-below ,mount-below))))) - (unwind-protect (propappapply propapp) + (unwind-protect (apply-propapp propapp) (mrun "sync") (mapc #'close-volume (get-connattr :opened-volumes))))) :args (cdr propapp))) diff --git a/src/property/installer.lisp b/src/property/installer.lisp index 60c17d7..bad2255 100644 --- a/src/property/installer.lisp +++ b/src/property/installer.lisp @@ -57,7 +57,7 @@ BOOTLOADER-TYPE to VOLUME.")) %install-bootloaders (running-on-target &rest propapps) (:retprop :type :lisp - :hostattrs (lambda () (mapc #'propappattrs propapps)) + :hostattrs (lambda () (mapc #'propapp-attrs propapps)) :apply (lambda () (mapc #'consfigure @@ -160,10 +160,10 @@ using a combinator like ON-CHANGE, or applied manually with DEPLOY-THESE." ;;; the definition of SERVICES:WITHOUT-STARTING-SERVICES to *AT-END-FUNCTIONS* ;;; in a closure. We'd also want %CONSFIGURE to use UNWIND-PROTECT to ensure ;;; that the AT-END functions get run even when there's a nonlocal exit from -;;; %CONSFIGURE's call to PROPAPPAPPLY; perhaps we could pass a second +;;; %CONSFIGURE's call to APPLY-PROPAPP; perhaps we could pass a second ;;; argument to the AT-END functions indicating whether there was a non-local ;;; transfer of control. REBOOT:REBOOTED-AT-END might only reboot when there -;;; was a normal return from PROPAPPAPPLY, whereas the cleanup forms from +;;; was a normal return from APPLY-PROPAPP, whereas the cleanup forms from ;;; SERVICES:WITHOUT-STARTING-SERVICES would always be evaluated. (defprop %root-filesystems-flipped :lisp (new-os old-os) diff --git a/src/property/libvirt.lisp b/src/property/libvirt.lisp index fff40d1..8ce80e1 100644 --- a/src/property/libvirt.lisp +++ b/src/property/libvirt.lisp @@ -120,13 +120,13 @@ already running, for a VM which is not always booted, e.g. on a laptop." (macrolet ((check-started (form) `(if (host-domain-started-p host) ,form :no-change))) - (:retprop :type (propapptype propapp) + (:retprop :type (propapp-type propapp) :desc (get (car propapp) 'desc) :hostattrs (get (car propapp) 'hostattrs) :apply (lambda-ignoring-args - (check-started (propappapply propapp))) + (check-started (apply-propapp propapp))) :unapply (lambda-ignoring-args - (check-started (propappunapply propapp))) + (check-started (unapply-propapp propapp))) :args (cdr propapp)))) ;; Another possible approach would be to convert DISK:VOLUME values to --disk diff --git a/src/property/lxc.lisp b/src/property/lxc.lisp index 02575ae..36fbd95 100644 --- a/src/property/lxc.lisp +++ b/src/property/lxc.lisp @@ -56,13 +56,13 @@ and owned by OWNER, defaulting to the current user, is already started." when-user-container-running* (host owner propapp) (macrolet ((check-running (form) `(if (user-container-running-p host owner) ,form :no-change))) - (:retprop :type (propapptype propapp) + (:retprop :type (propapp-type propapp) :desc (get (car propapp) 'desc) :hostattrs (get (car propapp) 'hostattrs) :apply (lambda-ignoring-args - (check-running (propappapply propapp))) + (check-running (apply-propapp propapp))) :unapply (lambda-ignoring-args - (check-running (propappunapply propapp))) + (check-running (unapply-propapp propapp))) :args (cdr propapp)))) (defproplist user-containers-autostart :posix (user) diff --git a/src/property/package.lisp b/src/property/package.lisp index 4548056..c4bb24c 100644 --- a/src/property/package.lisp +++ b/src/property/package.lisp @@ -38,11 +38,11 @@ Implementations should not fail just because we are not root, or otherwise privileged, if the package is already installed.")) (defmethod %installed ((package-manager (eql :apt)) packages) - ;; Call PROPAPPAPPLY directly because we want the :CHECK subroutine run, but - ;; it does not make sense to run the :HOSTATTRS subroutine because *HOST* - ;; does not necessarily correspond to the host we're attempting to install - ;; packages on. - (propappapply `(apt:installed ,@packages))) + ;; Call APPLY-PROPAPP directly because we want the :CHECK subroutine run, + ;; but it does not make sense to run the :HOSTATTRS subroutine because + ;; *HOST* does not necessarily correspond to the host we're attempting to + ;; install packages on. + (apply-propapp `(apt:installed ,@packages))) (define-simple-error package-manager-not-found (aborted-change)) diff --git a/src/property/periodic.lisp b/src/property/periodic.lisp index 4a75182..6dfd707 100644 --- a/src/property/periodic.lisp +++ b/src/property/periodic.lisp @@ -45,7 +45,7 @@ user." (merge-pathnames "at-most/" (get-connattr :consfigurator-cache))))) (destructuring-bind (psym . args) propapp - (:retprop :type (propapptype propapp) + (:retprop :type (propapp-type propapp) :desc (lambda-ignoring-args desc) :hostattrs (get psym 'hostattrs) :check @@ -63,7 +63,7 @@ user." (:yearly (< now (+ #.(ceiling (* 365.25 24 60 60)) mtime))))))) :apply (lambda-ignoring-args - (prog1 (propappapply propapp) + (prog1 (apply-propapp propapp) (file:containing-directory-exists flagfile) (mrun "touch" flagfile))) :args args)))) diff --git a/src/property/postfix.lisp b/src/property/postfix.lisp index 82a2ae2..75e25ec 100644 --- a/src/property/postfix.lisp +++ b/src/property/postfix.lisp @@ -37,10 +37,10 @@ (reloaded)))) (define-function-property-combinator mapped-file - (propapp &optional (file (car (propappargs propapp)))) + (propapp &optional (file (car (propapp-args propapp)))) "Apply PROPAPP, and if it makes a change, run postmap(1) on FILE, which defaults to the first argument to PROPAPP." - (:retprop :type (propapptype propapp) + (:retprop :type (propapp-type propapp) :desc (get (car propapp) 'desc) :check (get (car propapp) 'check) :hostattrs (get (car propapp) 'hostattrs) diff --git a/src/property/service.lisp b/src/property/service.lisp index ad920c9..6650244 100644 --- a/src/property/service.lisp +++ b/src/property/service.lisp @@ -84,8 +84,9 @@ properties." disable starting services by the package manager." (let ((propapp (if (cdr propapps) (apply #'eseqprops propapps) (car propapps)))) (:retprop :type :lisp - :hostattrs - (lambda () (propappattrs propapp) (os:required 'os:debianlike)) + :hostattrs (lambda () + (propapp-attrs propapp) + (os:required 'os:debianlike)) :apply (lambda (&aux (already-exists (file-exists-p +policyrcd+))) (with-remote-temporary-file (temp :directory "/usr/sbin") @@ -98,7 +99,7 @@ disable starting services by the package manager." ;; check that it's actually been a second. (loop do (sleep 1) until (> (get-universal-time) before)) (unwind-protect (with-connattrs (:no-services t) - (propappapply propapp)) + (apply-propapp propapp)) (if already-exists ;; Check whether some property we applied set the ;; contents of /usr/sbin/policy-rc.d, in which case @@ -107,4 +108,4 @@ disable starting services by the package manager." (rename-file temp +policyrcd+)) (when (file-exists-p +policyrcd+) (delete-file +policyrcd+))))))) - :unapply (lambda () (propappunapply propapp))))) + :unapply (lambda () (unapply-propapp propapp))))) -- cgit v1.2.3