Skip to content

Conversation

@sergiodj
Copy link
Contributor

@sergiodj sergiodj commented May 7, 2025

Sometimes it's useful to check how two versions relate to one another. Inspired by Debian's dpkg --compare-versions, I decided to implement our very own version comparison CLI.

@sergiodj sergiodj requested review from a team and jonjohnsonjr May 7, 2025 18:20
@sergiodj sergiodj force-pushed the compare-versions branch 2 times, most recently from 202f0c5 to a4c9591 Compare May 7, 2025 18:33
@murraybd
Copy link
Contributor

murraybd commented May 7, 2025

One thing that always bothered me about this argument with dpkg was having to check the exit code. Could we do something different?

@sergiodj
Copy link
Contributor Author

sergiodj commented May 7, 2025

One thing that always bothered me about this argument with dpkg was having to check the exit code. Could we do something different?

Certainly!

Do you have something in mind? I guess the command could accept a --silent argument, but otherwise be verbose about the result. WDYT?

@sergiodj sergiodj force-pushed the compare-versions branch from a4c9591 to 25fe9fc Compare May 8, 2025 15:11
@murraybd
Copy link
Contributor

murraybd commented May 8, 2025

One thing that always bothered me about this argument with dpkg was having to check the exit code. Could we do something different?

Certainly!

Do you have something in mind? I guess the command could accept a --silent argument, but otherwise be verbose about the result. WDYT?

No, I didn't have something specific in mind but your suggestion sounds good to me.

Sometimes it's useful to check how two versions relate to one another.
Inspired by Debian's `dpkg --compare-versions`, I decided to implement
our very own version comparison CLI.

Signed-off-by: Sergio Durigan Junior <sergiodj@chainguard.dev>
@sergiodj sergiodj force-pushed the compare-versions branch from 25fe9fc to 8d8ac7f Compare May 10, 2025 01:37
@sergiodj
Copy link
Contributor Author

One thing that always bothered me about this argument with dpkg was having to check the exit code. Could we do something different?

Certainly!
Do you have something in mind? I guess the command could accept a --silent argument, but otherwise be verbose about the result. WDYT?

No, I didn't have something specific in mind but your suggestion sounds good to me.

Great. I've force-pushed an implementation of my idea. Let me know what you think.

Thanks.

@xnox
Copy link
Member

xnox commented May 10, 2025

Sometimes it's useful to check how two versions relate to one another. Inspired by Debian's dpkg --compare-versions, I decided to implement our very own version comparison CLI.

And the apk version --test|--check is not enough?

See https://man.archlinux.org/man/apk-version.8.en for documentation

@sergiodj
Copy link
Contributor Author

Sometimes it's useful to check how two versions relate to one another. Inspired by Debian's dpkg --compare-versions, I decided to implement our very own version comparison CLI.

And the apk version --test|--check is not enough?

See https://man.archlinux.org/man/apk-version.8.en for documentation

It certainly fits the bill in a way, but I still believe it's useful to have melange's own version checker because, in the (unlikely?) scenario where we choose to deviate from apk's versioning scheme, having our own checker can really help.

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