On Mon, 2022-08-01 at 17:43 -0500, Joshua Watt wrote: > 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 <[email protected]> > --- > 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)) > +}
It makes me a little sad every time I see us turning variables into anonymous python :( I can understand why here but it still makes me sad and it does come at a performance price. Cheers, Richard
-=-=-=-=-=-=-=-=-=-=-=- Links: You receive all messages sent to this group. View/Reply Online (#168762): https://lists.openembedded.org/g/openembedded-core/message/168762 Mute This Topic: https://lists.openembedded.org/mt/92760036/21656 Group Owner: [email protected] Unsubscribe: https://lists.openembedded.org/g/openembedded-core/unsub [[email protected]] -=-=-=-=-=-=-=-=-=-=-=-
