Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imagefilter: use distrosort to sort the distro names #1175

Merged
merged 1 commit into from
Jan 29, 2025

Conversation

mvo5
Copy link
Contributor

@mvo5 mvo5 commented Jan 28, 2025

[build on top of https://github.com//pull/1173]

This commit uses the distrosort package to sort the distro names
by their name/version. This means that the output of centos is sorted
by low to high version like this:

$ ./image-builder list-images --output=short --filter distro:centos*
centos-9:
  ami: [ aarch64, x86_64 ]
  ...
centos-10:
  ami: [ aarch64, x86_64 ]
  ...

with the regular "string" search this was:

$ ./image-builder list-images --output=short --filter distro:centos*
centos-10:
  ami: [ aarch64, x86_64 ]
  ...
centos-9:
  ami: [ aarch64, x86_64 ]
  ...

(this is also quite visible with rhel).

achilleas-k
achilleas-k previously approved these changes Jan 28, 2025
supakeen
supakeen previously approved these changes Jan 28, 2025
Copy link
Member

@supakeen supakeen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I could probably argue for reverse sort order but I won't 😄.

This commit uses the `distrosort` package to sort the distro names
by their name/version. This means that the output of centos is sorted
by low to high version like this:
```console
$ ./image-builder list-images --output=short --filter distro:centos*
centos-9:
  ami: [ aarch64, x86_64 ]
  ...
centos-10:
  ami: [ aarch64, x86_64 ]
  ...
```

with the regular "string" search this was:
```console
$ ./image-builder list-images --output=short --filter distro:centos*
centos-10:
  ami: [ aarch64, x86_64 ]
  ...
centos-9:
  ami: [ aarch64, x86_64 ]
  ...
```
(this is also quite visible with rhel).
@mvo5 mvo5 dismissed stale reviews from supakeen and achilleas-k via 3c74aea January 29, 2025 08:03
@mvo5 mvo5 force-pushed the filter-distro-sort branch from 6445e02 to 3c74aea Compare January 29, 2025 08:03
@mvo5
Copy link
Contributor Author

mvo5 commented Jan 29, 2025

Sorry, conflicts, had to force push (which is a bit silly because there were actually none)

@mvo5 mvo5 added this pull request to the merge queue Jan 29, 2025
Merged via the queue into osbuild:main with commit b1e4312 Jan 29, 2025
18 checks passed
@mvo5 mvo5 deleted the filter-distro-sort branch January 29, 2025 10:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants