From 98b29ed4ce015721a85f45b87e051809eaf546f8 Mon Sep 17 00:00:00 2001 From: Sean Whitton Date: Sat, 23 Apr 2022 14:15:55 -0700 Subject: rename APT:MIRROR to APT:MIRRORS, use &rest and rename the hostattr Signed-off-by: Sean Whitton --- src/property/apt.lisp | 13 +++++-------- src/property/chroot.lisp | 4 ++-- src/property/sbuild.lisp | 2 +- 3 files changed, 8 insertions(+), 11 deletions(-) (limited to 'src/property') diff --git a/src/property/apt.lisp b/src/property/apt.lisp index 22ff04b..7486d45 100644 --- a/src/property/apt.lisp +++ b/src/property/apt.lisp @@ -190,17 +190,14 @@ only upgrade Debian stable." (file:does-not-exist "/etc/apt/apt.conf.d/50unattended-upgrades.ucf-dist") :unapply (removed "unattended-upgrades"))) -(defprop mirror :posix (uri) - (:desc #?"${uri} apt mirror selected") +(defprop mirrors :posix (&rest uris) + (:desc (format nil "apt mirror~P ~{~A~^, ~} selected" (length uris) uris)) (:hostattrs - (pushnew-hostattr :apt.mirror uri))) + (pushnew-hostattrs :apt.mirrors uris))) (defpropspec uses-parent-mirrors :posix () (:desc #?"Uses parent's apt mirror(s), if any") - (let ((mirrors (get-parent-hostattrs :apt-mirror))) - (and mirrors - `(eseqprops - ,@(loop for mirror in mirrors collect `(mirror ,mirror)))))) + (aand (get-parent-hostattrs :apt.mirrors) `(mirrors ,@it))) (defprop proxy :posix (uri) (:desc #?"${uri} apt proxy selected") @@ -221,7 +218,7 @@ only upgrade Debian stable." (proxy "http://[::1]:3142")) (defun get-mirrors () - (or (get-hostattrs :apt.mirror) + (or (get-hostattrs :apt.mirrors) (get-default-mirrors (get-hostattrs-car :os)))) (defmethod get-default-mirrors ((os os:debian)) diff --git a/src/property/chroot.lisp b/src/property/chroot.lisp index e894a9f..a61a9f5 100644 --- a/src/property/chroot.lisp +++ b/src/property/chroot.lisp @@ -30,12 +30,12 @@ (:apply (destructuring-bind (&key (apt.proxy (get-hostattrs-car :apt.proxy host)) - (apt.mirror (get-hostattrs-car :apt.mirror host)) + (apt.mirror (get-hostattrs-car :apt.mirrors host)) &allow-other-keys &aux (os (get-hostattrs-car :os host)) (args (list "debootstrap" (plist-to-long-options - (remove-from-plist options :apt.proxy :apt.mirror)) + (remove-from-plist options :apt.proxy :apt.mirrors)) (strcat "--arch=" (os:debian-architecture os)) (os:debian-suite os) root))) diff --git a/src/property/sbuild.lisp b/src/property/sbuild.lisp index a356d34..e0ce023 100644 --- a/src/property/sbuild.lisp +++ b/src/property/sbuild.lisp @@ -73,7 +73,7 @@ Example usage: (os:debian-stable \"bullseye\" :amd64) (apt:uses-local-cacher) - (apt:mirror \"...\") + (apt:mirrors \"...\") (sbuild:usable-by \"spwhitton\") (schroot:overlays-in-tmpfs) (periodic:at-most :monthly \"sbuild sid schroot rebuilt\" -- cgit v1.2.3