Hi,
in Mock version 1.4.14 [1] All mock configs are parsed and evaluated by Jinja2.
I'd like replace the include [2] to new style configuration . I tried some options , but can't find a way to replace include ... in RPMFusion configurations ...
BTW if it is easy , we may deprecated include , and start using Jinja2.
Thanks,
[1] https://github.com/rpm-software-management/mock/wiki/Release-Notes-1.4.14#mo...
[2] include('/etc/mock/fedora-30-x86_64.cfg')
Dne 04. 06. 19 v 7:36 Sérgio Basto napsal(a):
Hi,
in Mock version 1.4.14 [1] All mock configs are parsed and evaluated by Jinja2.
I'd like replace the include [2] to new style configuration . I tried some options , but can't find a way to replace include ... in RPMFusion configurations ...
BTW if it is easy , we may deprecated include , and start using Jinja2.
Thanks,
[1] https://github.com/rpm-software-management/mock/wiki/Release-Notes-1.4.14#mo...
[2] include('/etc/mock/fedora-30-x86_64.cfg')
I hoped for that as well. But...
I actually started to use Jinja2 in my local configs to see how it works. There is one huge problem: right now, the expansion happens when you read the value from dictionary, e.g.:
config_opts["foo"] = "version is {{releasever}}" ... self.config["foo"] # gives correctly "version is fc30"
however if you use in config:
{{ include foo.cfg }}
then you will get an error from mock, because every config is passed through eval() and treated as python code.
My first idea was to treat is as Jinja2 template and expand it first and only after expansion pass it to eval(). It will make the include functional, but... Then this will not work: config_opts["releasever"] = "fc30" config_opts["foo"] = "bar {{ releasever }}"
and I am runnig out of the ideas how to solve this.
buildsys@lists.fedoraproject.org