RFC: dynamic generation of mock config from template?

Vít Ondruch vondruch at redhat.com
Thu Jul 30 08:46:27 UTC 2015


Dne 30.7.2015 v 10:21 Miroslav Suchý napsal(a):
> Dne 30.7.2015 v 09:39 Vít Ondruch napsal(a):
>> On related note, I never understood why this is in configs:
>>
>>
>> $ cat /etc/mock/fedora-22-x86_64.cfg | grep \$releasever
>> metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-$releasever&arch=$basearch
>> metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-f$releasever&arch=$basearch
>> metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-f$releasever&arch=$basearch
>> metalink=https://mirrors.fedoraproject.org/metalink?repo=fedora-debug-$releasever&arch=$basearch
>> metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-released-debug-f$releasever&arch=$basearch
>> metalink=https://mirrors.fedoraproject.org/metalink?repo=updates-testing-debug-f$releasever&arch=$basearch
>>
>> I mean, is it f22 config or is it some generic config? When it says
>> fedora-22, I'd say that the $releasever should be expanded to "22" and
>> that should be it. The same applies to $basearch of course. Not
>> mentioning that on same places, it is already expanded:
> I think it is good when
>   config_opts['yum.conf']
> as closely as possible copy
>   /etc/yum.repos.d/fedora.repo
> In past (2 years ago) it diverged and had different baseurl (while yum.repos.d had metalink) which lead at least to one bug.
>

In that case, may be you should introduce $fedorarepofile variable and
use it as a placeholder for /etc/yum.repos.d/fedora.repo. I don't think
copy pasting the information around is the best practice.

And actually, neither I think this is good practice for
/etc/yum.repos.d/fedora.repo, since you cannot query various Fedora
releases at once.


Vít



More information about the buildsys mailing list