From bdaa1a3ab4733767f5ee38b79e7b5f171879135c Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sun, 21 Aug 2022 14:44:16 -0700 Subject: use WITH-CHANGES-DPKG-STATUS in preference to {ALL,NONE}-INSTALLED-P This fixes at least one bug: previously APT:INSTALLED and APT:INSTALLED-MINIMALLY would report that a change was made whenever the list of packages passed to them contained the name of a virtual package. Signed-off-by: Sean Whitton --- src/property/apt.lisp | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/property/apt.lisp b/src/property/apt.lisp index 36bbebd..a300793 100644 --- a/src/property/apt.lisp +++ b/src/property/apt.lisp @@ -44,19 +44,20 @@ (:desc #?"apt installed @{packages}") (:preprocess (flatten packages)) (:hostattrs (os:required 'os:debianlike)) - (:check (all-installed-p packages)) (:apply - (with-maybe-update (apt-get :inform "-y" "install" packages)))) + (with-maybe-update + (with-changes-dpkg-status + (apt-get :inform "-y" "install" packages))))) (defprop installed-minimally :posix (&rest packages) "Ensure all of the apt packages PACKAGES are installed, without recommends." (:desc #?"apt installed @{packages}") (:preprocess (flatten packages)) (:hostattrs (os:required 'os:debianlike)) - (:check (all-installed-p packages)) (:apply (with-maybe-update - (apt-get :inform "-y" "--no-install-recommends" "install" packages)))) + (with-changes-dpkg-status + (apt-get :inform "-y" "--no-install-recommends" "install" packages))))) (defun install-backports (args packages) (with-maybe-update @@ -93,10 +94,8 @@ each of those dependencies in PACKAGES." (:hostattrs (declare (ignore packages)) (os:required 'os:debianlike)) - (:check - (none-installed-p packages)) (:apply - (apt-get :inform "-y" "remove" packages))) + (with-changes-dpkg-status (apt-get :inform "-y" "remove" packages)))) (defprop reconfigured :posix (package &rest triples) "Where each of TRIPLES is a list of three strings, a debconf template, type -- cgit v1.2.3