From ff076e024f7be21ccb05e55fa1b39b4abdff56c4 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Tue, 21 Mar 2023 17:06:26 -0700 Subject: add REAPPLIED and PERIODIC:REAPPLIED-AT-MOST property combinators Signed-off-by: Sean Whitton --- src/property/periodic.lisp | 13 +++++++++++++ src/property/sbuild.lisp | 13 ++++++------- 2 files changed, 19 insertions(+), 7 deletions(-) (limited to 'src/property') 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: -- cgit v1.2.3