aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Whitton <spwhitton@spwhitton.name>2022-04-23 14:15:55 -0700
committerSean Whitton <spwhitton@spwhitton.name>2022-04-23 14:35:13 -0700
commit98b29ed4ce015721a85f45b87e051809eaf546f8 (patch)
tree6128871ace493eb9d16ca8d1eb937fe0455df7ed
parent2511ef04b3f5a2be6a87e46e4762aa33e1c8f937 (diff)
downloadconsfigurator-98b29ed4ce015721a85f45b87e051809eaf546f8.tar.gz
rename APT:MIRROR to APT:MIRRORS, use &rest and rename the hostattr
Signed-off-by: Sean Whitton <spwhitton@spwhitton.name>
-rw-r--r--doc/hosts.rst4
-rw-r--r--doc/introduction.rst2
-rw-r--r--src/package.lisp2
-rw-r--r--src/property/apt.lisp13
-rw-r--r--src/property/chroot.lisp4
-rw-r--r--src/property/sbuild.lisp2
6 files changed, 12 insertions, 15 deletions
diff --git a/doc/hosts.rst b/doc/hosts.rst
index 25829aa..af18d0d 100644
--- a/doc/hosts.rst
+++ b/doc/hosts.rst
@@ -41,8 +41,8 @@ keyword symbols. The semantics of these attributes are documented here:
- ``:OS``: the operating system of the host
-- ``:APT.MIRROR``: for hosts running Debian or a Debian derivative, the host's
- preferred apt mirror
+- ``:APT.MIRRORS``: for hosts running Debian or a Debian derivative, the
+ host's preferred apt mirrors
Host designators
----------------
diff --git a/doc/introduction.rst b/doc/introduction.rst
index d644273..ccc032b 100644
--- a/doc/introduction.rst
+++ b/doc/introduction.rst
@@ -42,7 +42,7 @@ Try it out / quick start
"Web and file server."
(os:debian-stable "buster" :amd64)
- (apt:mirror "http://my.local.mirror.example.com/")
+ (apt:mirrors "http://my.local.mirror.example.com/")
(apt:uses-local-cacher) ; sets up apt-cacher-ng
(apt:standard-sources.list)
diff --git a/src/package.lisp b/src/package.lisp
index a0b4206..5e9cd1c 100644
--- a/src/package.lisp
+++ b/src/package.lisp
@@ -516,7 +516,7 @@
#:autoremoved
#:periodic-updates
#:unattended-upgrades
- #:mirror
+ #:mirrors
#:uses-parent-mirrors
#:proxy
#:uses-parent-proxy
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\"