aboutsummaryrefslogtreecommitdiff
path: root/src/property/apt.lisp
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2021-06-16 11:45:17 -0700
committerSean Whitton <spwhitton@spwhitton.name>2021-06-16 11:45:17 -0700
commit6858d45ae5176b1c4e7623ce81e20386626715b4 (patch)
tree18f9d607d9ce14dd803140d9537a2c426115f6f5 /src/property/apt.lisp
parentc03d5d6369f4876c2a7637c4117c2e47e230e126 (diff)
downloadconsfigurator-6858d45ae5176b1c4e7623ce81e20386626715b4.tar.gz
add APT:INSTALLED-MINIMALLY, APT:ADDITIONAL-SOURCES
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property/apt.lisp')
-rw-r--r--src/property/apt.lisp24
1 files changed, 19 insertions, 5 deletions
diff --git a/src/property/apt.lisp b/src/property/apt.lisp
index c1e57ee..cb0e8cc 100644
--- a/src/property/apt.lisp
+++ b/src/property/apt.lisp
@@ -43,14 +43,21 @@
"Ensure all of the apt packages PACKAGES are installed."
(:desc #?"apt installed @{packages}")
(:preprocess (flatten packages))
- (:hostattrs
- (declare (ignore packages))
- (os:required 'os:debianlike))
- (:check
- (all-installed-p packages))
+ (:hostattrs (os:required 'os:debianlike))
+ (:check (all-installed-p packages))
(:apply
(with-maybe-update (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))))
+
(defprop removed :posix (&rest packages)
"Ensure all of the apt packages PACKAGES are removed."
(:desc #?"apt removed @{packages}")
@@ -204,6 +211,13 @@ only upgrade Debian stable."
(mapcan (lambda (l) (list #?"deb @{l}" #?"deb-src @{l}"))
(nconc archive security))))
+(defprop additional-sources :posix (basename content)
+ "Add additional apt source lines to a file in /etc/apt/sources.list.d named
+after BASENAME. CONTENT is as the content argument to FILE:HAS-CONTENT."
+ (on-change
+ (file:has-content #?"/etc/apt/sources.list.d/${basename}.list" content)
+ (updated)))
+
(defprop cache-cleaned :posix ()
"Empty apt's cache to recover disk space."
(:desc "apt cache cleaned")