aboutsummaryrefslogtreecommitdiff
path: root/src/property
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-03-21 17:06:26 -0700
committerSean Whitton <spwhitton@spwhitton.name>2023-03-21 17:06:26 -0700
commitff076e024f7be21ccb05e55fa1b39b4abdff56c4 (patch)
treefe8ac5d8b3acca204bee515988edb41c2846d115 /src/property
parenta1006865033988884f1f13e93e497eb0ec28abe4 (diff)
downloadconsfigurator-ff076e024f7be21ccb05e55fa1b39b4abdff56c4.tar.gz
add REAPPLIED and PERIODIC:REAPPLIED-AT-MOST property combinators
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src/property')
-rw-r--r--src/property/periodic.lisp13
-rw-r--r--src/property/sbuild.lisp13
2 files changed, 19 insertions, 7 deletions
diff --git a/src/property/periodic.lisp b/src/property/periodic.lisp
index 03b0b6b..0bf7851 100644
--- a/src/property/periodic.lisp
+++ b/src/property/periodic.lisp
@@ -67,3 +67,16 @@ user."
(file:containing-directory-exists flagfile)
(mrun "touch" flagfile)))
:args args))))
+
+(defmacro reapplied-at-most (period desc &body propapps)
+ "Apply PROPAPPS; only every PERIOD, also unapply them before applying them.
+
+This is useful to periodically redo the application of PROPAPPS.
+For example, you can use this to occasionally completely rebuild a
+CHROOT:OS-BOOTSTRAPPED chroot instead of only ever updating its contents.
+
+PERIOD and DESC are as for PERIODIC:AT-MOST, which see."
+ (let ((propapp (if (cdr propapps) `(eseqprops ,@propapps) (car propapps))))
+ `(eseqprops (desc ,(format nil "Unapplied ~(~A~): ~A" period desc)
+ (at-most* ,period ,desc (unapplied ,propapp)))
+ (desc ,desc ,propapp))))
diff --git a/src/property/sbuild.lisp b/src/property/sbuild.lisp
index 9a0eca6..90f6823 100644
--- a/src/property/sbuild.lisp
+++ b/src/property/sbuild.lisp
@@ -76,13 +76,12 @@ Example usage:
(apt:mirrors \"...\")
(sbuild:usable-by \"spwhitton\")
(schroot:overlays-in-tmpfs)
- (periodic:at-most :monthly \"sbuild sid schroot rebuilt\"
- (unapplied (sbuild:built. nil (os:debian-unstable :amd64))))
- (sbuild:built. nil
- (os:debian-unstable :amd64)
- (sbuild:standard-debian-schroot)
- (apt:uses-parent-proxy)
- (apt:uses-parent-mirrors))
+ (periodic:reapplied-at-most :monthly \"sbuild sid schroot (re)built\"
+ (sbuild:built. nil
+ (os:debian-unstable :amd64)
+ (sbuild:standard-debian-schroot)
+ (apt:uses-parent-proxy)
+ (apt:uses-parent-mirrors)))
To take advantage of the piuparts and autopkgtest support, add to your
~/.sbuildrc: