From 6c595f8124511b62ab15d1231c9d5edcb4836f89 Mon Sep 17 00:00:00 2001
From: Michel Alexandre Salim <salimma@centosproject.org>
Date: Jan 12 2023 18:54:55 +0000
Subject: Convert Hyperscale templates to use metalinks on Stream 9


These are available, we should not hardcode a single mirror

```
$ curl 'https://mirrors.centos.org/metalink?repo=unknown&arch=x86_64' -s | grep hyperscale | grep x86_64 | grep -v debug
 # repo=centos-hyperscale-sig-packages-experimental-9-stream&arch=x86_64
 # repo=centos-hyperscale-sig-packages-facebook-9-stream&arch=x86_64
 # repo=centos-hyperscale-sig-packages-main-9-stream&arch=x86_64
```

Signed-off-by: Michel Alexandre Salim <salimma@centosproject.org>

---

diff --git a/mock/templates/centos-stream-hyperscale-9.tpl b/mock/templates/centos-stream-hyperscale-9.tpl
index 5eb9ef4..8005397 100644
--- a/mock/templates/centos-stream-hyperscale-9.tpl
+++ b/mock/templates/centos-stream-hyperscale-9.tpl
@@ -4,7 +4,8 @@ config_opts['dnf.conf'] += """
 
 [Stream-hyperscale]
 name=CentOS Stream $releasever - Hyperscale
-baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-main/
+metalink=https://mirrors.centos.org/metalink?repo=centos-hyperscale-sig-packages-main-$releasever-stream&arch=$basearch&protocol=https,http
+#baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-main/
 gpgcheck=1
 enabled=1
 gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-SIG-HyperScale
diff --git a/mock/templates/centos-stream-hyperscale-experimental-9.tpl b/mock/templates/centos-stream-hyperscale-experimental-9.tpl
index 61c9b33..19535a2 100644
--- a/mock/templates/centos-stream-hyperscale-experimental-9.tpl
+++ b/mock/templates/centos-stream-hyperscale-experimental-9.tpl
@@ -4,7 +4,8 @@ config_opts['dnf.conf'] += """
 
 [Stream-hyperscale-experimental]
 name=CentOS Stream $releasever - Hyperscale Experimental
-baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-experimental/
+metalink=https://mirrors.centos.org/metalink?repo=centos-hyperscale-sig-packages-experimental-$releasever-stream&arch=$basearch&protocol=https,http
+#baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-experimental/
 gpgcheck=1
 enabled=1
 gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-SIG-HyperScale
diff --git a/mock/templates/centos-stream-hyperscale-facebook-9.tpl b/mock/templates/centos-stream-hyperscale-facebook-9.tpl
index 260ded1..d7ce06d 100644
--- a/mock/templates/centos-stream-hyperscale-facebook-9.tpl
+++ b/mock/templates/centos-stream-hyperscale-facebook-9.tpl
@@ -2,7 +2,8 @@ config_opts['dnf.conf'] += """
 
 [Stream-hyperscale-facebook]
 name=CentOS Stream $releasever - Hyperscale Facebook
-baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-facebook/
+metalink=https://mirrors.centos.org/metalink?repo=centos-hyperscale-sig-packages-facebook-$releasever-stream&arch=$basearch&protocol=https,http
+#baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-facebook/
 gpgcheck=1
 enabled=1
 gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-SIG-HyperScale
diff --git a/mock/templates/centos-stream-hyperscale-spin-9.tpl b/mock/templates/centos-stream-hyperscale-spin-9.tpl
index 6ec665a..5f6703e 100644
--- a/mock/templates/centos-stream-hyperscale-spin-9.tpl
+++ b/mock/templates/centos-stream-hyperscale-spin-9.tpl
@@ -2,7 +2,8 @@ config_opts['chroot_setup_cmd'] += " centos-release-hyperscale-spin"
 
 [Stream-hyperscale-spin]
 name=CentOS Stream $releasever - Hyperscale Spin
-baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-spin/
+metalink=https://mirrors.centos.org/metalink?repo=centos-hyperscale-sig-packages-spin-$releasever-stream&arch=$basearch&protocol=https,http
+#baseurl=http://mirror.stream.centos.org/SIGs/$releasever-stream/hyperscale/$basearch/packages-spin/
 gpgcheck=1
 enabled=1
 gpgkey=file:///usr/share/distribution-gpg-keys/centos/RPM-GPG-KEY-CentOS-SIG-HyperScale

