diff mbox series

[OSSTEST,3/7] Debian mirror selection: Provide debian_archive_url_suite_arch

Message ID 20210209175904.28282-3-iwj@xenproject.org (mailing list archive)
State New, archived
Headers show
Series [OSSTEST,1/7] mg-debian-installer-update: Honour redirect for dtbs | expand

Commit Message

Ian Jackson Feb. 9, 2021, 5:59 p.m. UTC
mg-debian-installer-update is going to want this.  NFC.

Signed-off-by: Ian Jackson <iwj@xenproject.org>
---
 Osstest/Debian.pm | 15 +++++++++------
 1 file changed, 9 insertions(+), 6 deletions(-)
diff mbox series

Patch

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 05cc6e1f..dee52b3d 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -814,12 +814,8 @@  chmod 600 $subdir/etc/ssh/ssh_host_*_key ||:
 END
 }
 
-sub debian_mirror_url ($) {
-    # I think ideally this should handle, and be used for, backports too.
-    # It would need an optional suite suffix which could be "-backports"?
-    my ($ho) = @_;
-    my $suite = $ho->{Suite};
-    my $arch = $ho->{Arch};
+sub debian_mirror_url_suite_arch ($$) {
+    my ($suite, $arch) = @_;
     my $url =
       $c{"DebianMirror_${suite}_${arch}"} //
       $c{"DebianMirror_${suite}"} //
@@ -830,6 +826,13 @@  sub debian_mirror_url ($) {
     return $url;
 }
 
+sub debian_mirror_url ($) {
+    # I think ideally this should handle, and be used for, backports too.
+    # It would need an optional suite suffix which could be "-backports"?
+    my ($ho) = @_;
+    return debian_mirror_url_suite_arch($ho->{Suite}, $ho->{Arch});
+}
+
 sub debian_mirror_host_path ($) {
     my ($ho) = @_;
     my $url = debian_mirror_url($ho);