Reworks own-mirrors.bbclass to allow multiple URLs to be listed in the
SOURCE_MIRROR_URL variable. This allows a hierarchy of premirrors to be
defined where URLs earlier in the list will be tried before the later
ones.

Signed-off-by: Joshua Watt <jpewhac...@gmail.com>
---
 meta/classes/own-mirrors.bbclass | 31 +++++++++++++++++--------------
 1 file changed, 17 insertions(+), 14 deletions(-)

diff --git a/meta/classes/own-mirrors.bbclass b/meta/classes/own-mirrors.bbclass
index ef972740ce..dcb4456222 100644
--- a/meta/classes/own-mirrors.bbclass
+++ b/meta/classes/own-mirrors.bbclass
@@ -1,14 +1,17 @@
-PREMIRRORS:prepend = " \
-cvs://.*/.*     ${SOURCE_MIRROR_URL} \
-svn://.*/.*     ${SOURCE_MIRROR_URL} \
-git://.*/.*     ${SOURCE_MIRROR_URL} \
-gitsm://.*/.*   ${SOURCE_MIRROR_URL} \
-hg://.*/.*      ${SOURCE_MIRROR_URL} \
-bzr://.*/.*     ${SOURCE_MIRROR_URL} \
-p4://.*/.*      ${SOURCE_MIRROR_URL} \
-osc://.*/.*     ${SOURCE_MIRROR_URL} \
-https?://.*/.*  ${SOURCE_MIRROR_URL} \
-ftp://.*/.*     ${SOURCE_MIRROR_URL} \
-npm://.*/?.*    ${SOURCE_MIRROR_URL} \
-s3://.*/.*      ${SOURCE_MIRROR_URL} \
-"
+python() {
+    for m in reversed(d.getVar("SOURCE_MIRROR_URL").split()):
+        d.prependVar("PREMIRRORS", " \
+cvs://.*/.*     {m} \
+svn://.*/.*     {m} \
+git://.*/.*     {m} \
+gitsm://.*/.*   {m} \
+hg://.*/.*      {m} \
+bzr://.*/.*     {m} \
+p4://.*/.*      {m} \
+osc://.*/.*     {m} \
+https?://.*/.*  {m} \
+ftp://.*/.*     {m} \
+npm://.*/?.*    {m} \
+s3://.*/.*      {m} \
+".format(m=m))
+}
-- 
2.33.0

-=-=-=-=-=-=-=-=-=-=-=-
Links: You receive all messages sent to this group.
View/Reply Online (#168761): 
https://lists.openembedded.org/g/openembedded-core/message/168761
Mute This Topic: https://lists.openembedded.org/mt/92760036/21656
Group Owner: openembedded-core+ow...@lists.openembedded.org
Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub 
[arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-

Reply via email to