Re: autobuilder: How to set PREMIRRORS?


Bryan Evenson
 

Elizabeth,

Thanks for the tips. I think I have something close to working, just need to finish testing. I should have a patch for you the first week of January.

Thanks,
Bryan E.

-----Original Message-----
From: Flanagan, Elizabeth [mailto:elizabeth.flanagan@...]
Sent: Tuesday, December 16, 2014 3:14 PM
To: Bryan Evenson
Cc: yocto@...
Subject: Re: autobuilder: How to set PREMIRRORS?

2014-11-19 15:12 GMT+00:00 Bryan Evenson <bevenson@...>:
All,

I'm getting close to implementing this feature, but I'm having some issues
getting auto.conf formatted correctly. See below.

-----Original Message-----
From: Bryan Evenson
Sent: Monday, November 17, 2014 9:08 AM
To: Bryan Evenson; yocto@...;
elizabeth.flanagan@...
Subject: RE: autobuilder: How to set PREMIRRORS?

All,

After looking through the autobuilder code, I don't see anywhere in which
PREMIRRORS can be set and used. I see in CreateAutoConf.py that
PREMIRRORS is always set to "". I don't think it'd be that difficult to add
PREMIRRORS as a CreateAutoConf parameter for the buildsets. I can
work
on the change and submit the patch. But before I start I have a few
questions:

1. I plan on implementing the PREMIRRORS parameter as an array, similar
to
'layerdirs' for CreateBBLayersConf. For example:

{'CreateAutoConf' : {'PREMIRRORS' : ['git://.*/.*
http://our/local/mirror/path/mirror/sources/ ',
'ftp://.*/.* http://our/local/mirror/path /mirror/sources/ ',
'http://.*/.* http://our/local/mirror/path/mirror/sources/ ',
'https://.*/.* http://our/local/mirror/path/mirror/sources/ ']}

would add the following to auto.conf:

PREMIRRORS = 'git://.*/.* http://our/local/mirror/path/mirror/sources/
\
ftp://.*/.* http://our/local/mirror/path /mirror/sources/ \
http://.*/.* http://our/local/mirror/path/mirror/sources/ \
https://.*/.* http://our/local/mirror/path/mirror/sources/ '

Does this sound reasonable, or would a different parameter format be
preferred?
I would actually do this similar to how we have DEVKERNEL_MUT_REPO.

PREMIRRORS = ['git://.*/.*
http://our/local/mirror/path/mirror/sources/', 'ftp://.*/.*
http://our/local/mirror/path /mirror/sources/', 'http://.*/.*
http://our/local/mirror/path/mirror/sources/', 'https://.*/.*
http://our/local/mirror/path/mirror/sources/']

I am trying to add a single PREMIRROR using the syntax I specified above.
At this time it is getting inserted in auto.conf. However, the system is going
into an infinite loop building the PREMIRROR path. The added content to
auto.conf at this time looks like:

PREMIRRORS = " \
http://.*.* http://server.repo.local/mirror/sources/ \n \
"

And from looking at log.do_fetch for the package that attempts to use the
PREMIRROR, the log is filled with
"server.repo.localserver.repo.localserver.repo.local" repeating. Any tips on
how PREMIRRORS should be built?

Here's what I have so far in CreateAutoConf.py:

self.PREMIRRORS=""
fout = fout + 'PREMIRRORS = " \ \n'
if list(self.PREMIRRORS):
for premirror in self.PREMIRRORS:
fout = fout + premirror + ' \\\\n \ \n'
fout = fout + '" \n'

Any tips on how to change things so PREMIRRORS is correctly parsed?
#make sure you add
#
#export PREMIRRORS=""
# to yocto-autobuilder-setup

if os.environ.get('PREMIRRORS') is not None:
premirrors=ast.liternal_eval(os.environ.get('PREMIRRORS').encode('utf-8')
fout =+ 'PREMIRRORS = "\ \n'
for mirror in premirrors:.....

I think this should do what you're looking for.

Thanks,
Bryan
--
Elizabeth Flanagan
Yocto Project
Build and Release

Join {yocto@lists.yoctoproject.org to automatically receive all group messages.