Allow matching on ID_LIKE from /etc/os-release
Closes #104 (closed)
Merge request reports
Activity
added enhancement label
- Resolved by Jakub Ružička
- Resolved by Jakub Ružička
- Resolved by Jakub Ružička
I don't like this brings hidden state and special behavior for auto-detected distro.
In particular, imagine running on CentOS 9:
apkg build
will match
rhel
butapkg build -d 'centos-9'
won't match
rhel
as its_like
isn't available.Such inconsistent unpredictable behavior feels like disservice to users.
@mistotebe I'll have a look at providing an equivalent of this through distro aliases in a consistent manner as described in #104 (closed) - continuing this there.
mentioned in issue #104 (closed)
added 9 commits
-
de4be7f9...75f61c2d - 6 commits from branch
master
- 9226c286 - Correct distro name matching
- 171ac3f4 - Correct version handling of versionless distros
- a091bf01 - Add distro_like templatevar module
Toggle commit list-
de4be7f9...75f61c2d - 6 commits from branch
Latest version includes a patch for #107 (closed) as well since both of them depends on similar fixes/changes in
Distro()
.mentioned in merge request !181 (closed)
- Resolved by Jakub Ružička
- Resolved by Jakub Ružička
added 1 commit
- b79aa8d1 - distro: Ignore invalid versions of current distro
- Resolved by Jakub Ružička
added 9 commits
-
4be293ce...faa05835 - 3 commits from branch
master
- 07cba360 - Correct distro name matching
- 4a8c6a07 - Correct version handling of versionless distros
- 9902eaf9 - Add distro_like templatevar module
- 220721d7 - distro: ignore invalid versions of current distro
- 34c64ca0 - distro_like: align newlines with rest of the code
- 003a5ba8 - pkgstyle: use Distro.match in template selection
Toggle commit list-
4be293ce...faa05835 - 3 commits from branch
added 8 commits
-
003a5ba8...b540b9ef - 2 commits from branch
master
- 63c00289 - Correct distro name matching
- 3c229bb1 - Correct version handling of versionless distros
- 9b90c30f - Add distro_like templatevar module
- 81968e84 - distro: ignore invalid versions of current distro
- e4e55b40 - distro_like: align newlines with rest of the code
- 4bd29390 - pkgstyle: use Distro.match in template selection
Toggle commit list-
003a5ba8...b540b9ef - 2 commits from branch
- Resolved by Jakub Ružička
OK, I have last few suggestions as I didn't want to touch your code ;)
- squash
distro_like: align newlines with rest of the code
intoAdd distro_like templatevar module
- rename the commit message headers to match (arguably weird) convention from other commits:
distro: introduce multiple distro names distro: correct version handling of versionless distros distro_like: new template variables module for distro.like
This helps with NEWS preparation and stats.
I'll try to fix the CI fallout in the meantime, the failures aren't relevant to this MR.
- squash
added 5 commits
Toggle commit listadded 6 commits
- 63c00289 - Correct distro name matching
- 3c229bb1 - Correct version handling of versionless distros
- 9b90c30f - Add distro_like templatevar module
- 81968e84 - distro: ignore invalid versions of current distro
- e4e55b40 - distro_like: align newlines with rest of the code
- 9e7e692d - pkgstyle: use Distro.match in template selection
Toggle commit listadded 5 commits
Toggle commit list- Resolved by Jakub Ružička
added 2 commits
added 1 commit
- 2d54dcbb - distro_like: cover in examples/template-variables
So when testing I discovered the code doesn't really work so I fixed it and also added example/test coverage so this doesn't happen in the future unnoticed.
Feel free to squash the fix/refactor commits into your main one or leave them be as you see fit.
Finally, I've noticed a naming inconsistency:
I custom variables from python_module: apkg.templatevars.debseries I custom variables from python_module: apkg.templatevars.distro_like
debseries
module is lacking_
even though it providesdeb_series
anddeb_codename
(with_
).Core
apkg
modules evade underscores all-togehter, only command modules use them.By this convention, is should be
distrolike
module. This has the advantage of distinct refernce to the module (distrolike
) vs the variable (distro_like
).It's too late to change
debseries
->deb_series
I think.What do you think?
I was thinking about this and it might be cleaner to go with the
camel_case
for template var modules as you did, consistent with variable naming as well as command modules naming.I'll probably rename
debseries
todeb_series
and provide backward compat (debseries.py
) which will throw a warning - to be removed in 1.0. But that's for another MR so this is probably ready to merge.
added 1 commit
- d002bb54 - distro_like: describe in docs/templatevars.md
mentioned in commit 3573d4c5