Skip to content
Snippets Groups Projects

Allow matching on ID_LIKE from /etc/os-release

Merged Ondřej Kuzník requested to merge distro_like_match into master
1 unresolved thread

Closes #104 (closed)

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
    • 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 but

      apkg 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)

  • Ondřej Kuzník added 9 commits

    added 9 commits

    Compare with previous version

  • Latest version includes a patch for #107 (closed) as well since both of them depends on similar fixes/changes in Distro().

  • Ondřej Kuzník mentioned in merge request !181 (closed)

    mentioned in merge request !181 (closed)

  • added 1 commit

    • b79aa8d1 - distro: Ignore invalid versions of current distro

    Compare with previous version

  • Jakub Ružička added 2 commits

    added 2 commits

    • 09ef0e0b - distro_like: Align newlines with rest of the code
    • 4793e06c - pkgstyle: use Distro.match in template selection

    Compare with previous version

  • Ondřej Kuzník
  • added 1 commit

    • 4be293ce - adistro: Don't parse `version=None`

    Compare with previous version

  • Jakub Ružička added 9 commits

    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

    Compare with previous version

  • Jakub Ružička added 8 commits

    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

    Compare with previous version

    • 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 into Add 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.

  • Ondřej Kuzník added 5 commits

    added 5 commits

    • 5435c832 - distro: Correct distro name matching
    • 31d4780f - distro: Correct version handling of versionless distros
    • e539ba52 - distro_like: Add distro_like templatevar module
    • 1c7d3614 - distro: ignore invalid versions of current distro
    • 379b297f - pkgstyle: use Distro.match in template selection

    Compare with previous version

  • Jakub Ružička added 6 commits

    added 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

    Compare with previous version

  • Jakub Ružička added 5 commits

    added 5 commits

    • 3651b6d4 - distro: introduce multiple distro names
    • 7085a5fa - distro: correct version handling of versionless distros
    • 2aa83b3e - distro_like: new template variables module
    • 18f2c1cb - distro: ignore invalid versions of current distro
    • 5a061188 - pkgstyle: use Distro.match in template selection

    Compare with previous version

  • Jakub Ružička resolved all threads

    resolved all threads

  • Jakub Ružička
  • Jakub Ružička resolved all threads

    resolved all threads

  • Jakub Ružička added 2 commits

    added 2 commits

    • 0bb798e9 - distro_like: fix code
    • 6145868a - distro_like: refactor distro -> distro_mod

    Compare with previous version

  • added 1 commit

    • 2d54dcbb - distro_like: cover in examples/template-variables

    Compare with previous version

    • 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 provides deb_series and deb_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 to deb_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.

    • Please register or sign in to reply
  • added 1 commit

    • d002bb54 - distro_like: describe in docs/templatevars.md

    Compare with previous version

  • mentioned in commit 3573d4c5

  • Please register or sign in to reply
    Loading