aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2023-12-05 15:02:24 +0000
committerSean Whitton <spwhitton@spwhitton.name>2023-12-05 15:02:24 +0000
commit280842d4e777a78c9b26de97f9f7fd5d5c17f9c7 (patch)
treebc73da8d0fe6f2986fcf884a79c3fac0c86e7281 /src
parent8627902ff12d620399d0fbc455c639f2db7843f1 (diff)
downloadconsfigurator-280842d4e777a78c9b26de97f9f7fd5d5c17f9c7.tar.gz
FILE:HOST-{DATA,SECRET}-UPLOADED: accept multiple files to upload
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
Diffstat (limited to 'src')
-rw-r--r--src/property/file.lisp31
1 files changed, 18 insertions, 13 deletions
diff --git a/src/property/file.lisp b/src/property/file.lisp
index 8ab31d1..f5866c8 100644
--- a/src/property/file.lisp
+++ b/src/property/file.lisp
@@ -173,13 +173,15 @@ any of the regular expressions PATTERNS."
(containing-directory-exists destination)
(maybe-write-remote-file-data destination iden1 iden2)))
-(defproplist host-data-uploaded :posix
- (destination
- ;; Require an absolute path because we don't know the remote home
- ;; directory at hostattrs time, so can't resolve it ourselves.
- &aux (destination (unix-namestring
- (ensure-pathname destination :want-absolute t))))
- (data-uploaded (get-hostname) destination destination))
+(defpropspec host-data-uploaded :posix (&rest destinations)
+ (loop with hn = (get-hostname)
+ for destination in destinations
+ ;; Require absolute paths because we don't know the remote home
+ ;; directory at hostattrs time, so can't resolve it ourselves.
+ for destination* = (unix-namestring
+ (ensure-pathname destination :want-absolute t))
+ collect `(data-uploaded ,hn ,destination* ,destination*) into propapps
+ finally (return (cons 'seqprops propapps))))
(defprop secret-uploaded :posix (iden1 iden2 destination)
(:desc #?"${destination} installed")
@@ -189,12 +191,15 @@ any of the regular expressions PATTERNS."
(:apply
(maybe-write-remote-file-data destination iden1 iden2 :mode #o600)))
-(defproplist host-secret-uploaded :posix
- (destination
- ;; Require an absolute path like with HOST-DATA-UPLOADED.
- &aux (destination (unix-namestring
- (ensure-pathname destination :want-absolute t))))
- (secret-uploaded (get-hostname) destination destination))
+(defpropspec host-secret-uploaded :posix (&rest destinations)
+ (loop with hn = (get-hostname)
+ for destination in destinations
+ ;; Require absolute paths like with HOST-DATA-UPLOADED.
+ for destination* = (unix-namestring
+ (ensure-pathname destination :want-absolute t))
+ collect `(secret-uploaded ,hn ,destination* ,destination*)
+ into propapps
+ finally (return (cons 'seqprops propapps))))
(defprop data-cache-purged :posix ()
"Ensure that any prerequisite data cached in the remote home directory is removed."