Comments (10)
As a workaround, I can use config_opts["dnf.conf"]
which seems to work both with dnf and dnf5.
from mock.
-
config_opts.package_manager
does not exist. config_opts is a dictionary. -
You can use this:
include('fedora-39-x86_64.cfg')
config_opts['__jinja_expand']=True
config_opts[f"{config_opts['package_manager']}.conf"] += """
# whatever
"""
config_opts['__jinja_expand']=False
This is because of https://github.com/xsuchy/templated-dictionary?tab=readme-ov-file#enabling-expansion which has other reason that is stored somewhere in git-log. I can dig it up if you are really curious.
This is normally not needed for values, but required for keys. I should probably document it.
from mock.
config_opts.package_manager
somehow exists. I don't know how, but it does.
from mock.
>>> from templated_dictionary import TemplatedDictionary
>>> td = TemplatedDictionary()
>>> td['package_manager'] = 'dnf'
>>> td.package_manager
'dnf'
from mock.
TemplatedDictionary stores the value:key pairs in self.__dict__
, making them accessible as attributes.
from mock.
As a side issue I've opened xsuchy/templated-dictionary#4
from mock.
@xsuchy wrote:
You can use this:
include('fedora-39-x86_64.cfg')
config_opts['__jinja_expand']=True
config_opts[f"{config_opts['package_manager']}.conf"] += """
Actually you can not, jinja is only supported in values, not in keys.
from mock.
Actually you can not, jinja is only supported in values, not in keys.
Wrong -> that's a f-string, not jinja. Sorry, you can use that. But ... it is unnecessary, you can simply use dnf.conf
instead of abstracting the package_manager out. dnf.conf
and yum.conf
is completely equivalent key (these are aliased to each other).
from mock.
(This issue is not blocking me in any way. But it is a regression nevertheless. If you decide to wontfix it, I'm OK with that.)
from mock.
I'm careful to call this a regression because a) Jinja in the
TemplatedDictionary keys never worked, and yet b) it is expected to use Jinja in
TemplatedDictionary values. So your change in #1332 was fine from this
perspective.
So such a problem happens when we use config_opts values for specifying
config_opts keys. This limiting factor was always there - and nothing has
changed or regressed for several Mock releases.
This admittedly was/is a serious problem, though. The copr mock-config
used to
provide the unfortunate output
(config_opts[f"{config_opts['package_manager']}.conf"] = ...
), and if cached
by our user - the problem still keeps appearing somewhere in the wild.
I decided to WONTFIX this particular instance of Jinja-in-key problem before
:-) because I thought there was no better way to achieve the result. But now I
think there is, namely using the logic from #1347.
from mock.
Related Issues (20)
- Config parser error
- Broken bash completion HOT 2
- SSH Agent Forwarding HOT 2
- Reset icon name and window title when leaving shell HOT 4
- Mock hangs in 'Finish(bootstrap): installing dnf tooling' setting up F39 chroot HOT 10
- Could mock-core-configs use fedora-distro-aliases somehow? HOT 5
- openSUSE build fails in Fedora Copr HOT 14
- Use Fedora-based DNF5 capable bootstrap images HOT 1
- RFE: automatically import key for F(N+1) when building for rawhide HOT 5
- Mock build can produce two SRPM packages in the results directory HOT 3
- ERROR: type object 'FileDownloader' has no attribute 'backmap'
- oraclelinux+epel-7-x86_64 does not populate %rhel nor %oraclelinux macros HOT 2
- `--scrub=all` doesn't appear to remove files for anything but the current running Fedora version HOT 1
- `mock --init` occasinally fails with `ERROR: stat: path should be string, bytes, os.PathLike or integer, not NoneType` HOT 4
- RFE: download build artifacts after %install and before %check phase HOT 2
- subid nss provider breaks mock HOT 8
- Calculate spec/srpm (dynamic) build requires as a separate build mode HOT 1
- Document Dynamic BuildRequires feature HOT 3
- Allow users specify the user-specific config via an environmental variable HOT 7
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mock.