bugGNU Octave - Bugs: bug #55838, compare_versions: add support for...


bug #55838: compare_versions: add support for deb/rpm style "~" version sorting

Submitted by:  Mike Miller <mtmiller>
Submitted on:  Tue 05 Mar 2019 08:05:16 PM UTC  
Category:  Octave Function Severity:  1 - Wish
Priority:  5 - Normal Item Group:  Feature Request
Status:  None Assigned to:  None
Originator Name:  Open/Closed:  Open
Release:  dev Operating System:  Any

Add a New Comment (Rich Markup)

You are not logged in

Please log in, so followups can be emailed to you.


Wed 20 Mar 2019 10:22:41 PM UTC, comment #3: 

I'm a big SemVer fan, so "-" is cool with me too. I don't have a strong preference between them; just support for some suffix that means "before" and is attached to the upcoming release instead of the old one.

Andrew Janke <apjanke>
Wed 20 Mar 2019 09:57:50 PM UTC, comment #2: 

Thanks for the +1. I do still plan on a maintainers list post, I just haven't had time to draft something short and clear yet.

That's a good counterargument against the "+" suffix, justifying the rationale for something to act as a pre-release suffix.

While I personally like the "~" special character because of my association with Debian, I can also see the argument in favor of adopting the Semantic Versioning "-" suffix rule.

Mike Miller <mtmiller>
Project Administrator
Wed 20 Mar 2019 09:23:32 PM UTC, comment #1: 

This would be nice to have.

One advantage is that the “1.0.0+” style of numbering is ambiguous: you can’t tell if that development stream is getting ready for 1.0.1, 1.1.0, or 2.0.0. If a project does maintenance releases on older major/minor versions, any or all of those could be in development at the same time.

Andrew Janke <apjanke>
Tue 05 Mar 2019 08:05:16 PM UTC, original submission:  

I think it would be nice if Octave's 'compare_versions' function supported the special case sorting of the tilde ('~') character as defined by both the deb and rpm package formats.

Under this definition, any suffix of a version string that starts with '~' sorts strictly less than the same string with the suffix completely removed. Any characters after the '~' sort normally. For example, "1.0.0+" is greater than "1.0.0" simply because it adds a suffix. With this change made, "1.0.0~" is less than "1.0.0". And "1.0.0~a" is greater than "1.0.0~"

I will raise this on the maintainers list as well to see if there are any strong objections, but I hope it's non-controversial since it's already supported by both deb and rpm packaging tools.

One risk is that making this change might break existing sorting if any third-party code is using compare_versions and using the '~' character. No Octave Forge packages currently use '~'.

Mike Miller <mtmiller>
Project Administrator


(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:

No files currently attached


Depends on the following items: None found

Items that depend on this one: None found


Carbon-Copy List
  • -email is unavailable- added by apjanke (Posted a comment)

    Do you think this task is very important?
    If so, you can add your encouragement to it.
    This task has 0 encouragements so far.

    Only project members can vote.




    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2019-03-05 mtmiller Carbon-CopyRemoved 80942 => -

    Back to the top

    Powered by Savane 3.5