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

Add support for sorting caret ('^') higher than base version #88

Closed
wants to merge 1 commit into from

Conversation

ignatenkobrain
Copy link
Contributor

@ignatenkobrain ignatenkobrain commented Sep 10, 2016

1.1^20160101 means 1.1 version (base) and patches which were applied at
that date on top of it.

  • 1.1^201601 > 1.1
  • 1.1^201601 < 1.1.1

Second case might be fulfilled with tilde separator, but it's not obvious
and doesn't fulfil first case.

Signed-off-by: Igor Gnatenko i.gnatenko.brain@gmail.com

@ignatenkobrain ignatenkobrain changed the title Add support for sorting '+' higher than base verion Add support for sorting '+' higher than base version Sep 10, 2016
@@ -45,6 +45,20 @@ int rpmvercmp(const char * a, const char * b)
continue;
}

/*
* Handle plus separator. Concept is same as tilde, but it one of
* strings ends, it's considered as lower version.
Copy link
Member

Choose a reason for hiding this comment

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

Shouldn't this read "it's considered as higher version"?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

no.

@Conan-Kudo
Copy link
Member

Looks good to me! 👍

1.1^20160101 means 1.1 version (base) and patches which were applied at
that date on top of it.

* 1.1^201601 > 1.1
* 1.1^201601 < 1.1.1

Second case might be fulfilled with tilde separator, but it's not obvious
and doesn't fulfil first case.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
@ignatenkobrain ignatenkobrain changed the title Add support for sorting '+' higher than base version Add support for sorting caret ('^') higher than base version Sep 12, 2016
@ignatenkobrain
Copy link
Contributor Author

Changed to caret as @ffesti requested in ML.

@ffesti
Copy link
Contributor

ffesti commented Oct 12, 2016

OK, looks like Fedora is going for a policy that works with the current version compare. If version and release strings are chosen with some care (which they have to be anyway) I do not really see an immediate need for this. Closing for now.

@ffesti ffesti closed this Oct 12, 2016
@pmatilai pmatilai deleted the plus branch October 28, 2016 11:07
@ignatenkobrain
Copy link
Contributor Author

@ffesti @pmatilai we've discussed this roughly a bit today during our FPC meeting and we pretty much agreed that it would be very good to have this in RPM. Because right now when you want to make post-release snapshot, you would use 1.2+20180101.deadbeef and then if upstream releases 1.2.1, you are screwed.

Can we re-open this please?

@Conan-Kudo
Copy link
Member

@ignatenkobrain That's why you're supposed to do something like 1.2+git20180101.deadbeef, so that it sorts lower than 1.2.1.

@ignatenkobrain
Copy link
Contributor Author

I can go further with some worse examples like openssl ;)

1.1.0+gitdeadbeef > 1.1.0a

@Conan-Kudo
Copy link
Member

You crush my soul. 😢

@ignatenkobrain
Copy link
Contributor Author

I mean if we have tilde, there is a need to have operator which is doing opposite -- that is caret ;)

@jasontibbitts
Copy link

Hey, this was just pointed out to me, and it seems to perfectly provide a solution to a problem.

As many might be aware, the Fedora packaging committee has periodically taken up the issue of using tilde Version:. And I've been putting in a load of effort trying to come up with a consistent scheme which actually covers the range of cases that our current scheme does.

One thing I've run into is that tilde is one of a pair of operators you actually need to implement a scheme which consistently places information about snapshots into the Version: field. If you use tilde, you can (and in some cases must) move prerelease information on snapshots into Version:, but information on post-release snapshots has to stay in Release: because you cannot know what upstream will call the next version.

So you can't do 3.2 < 3.2(snapshot) < 3.2.1 because there's nothing you can fill in for (snapshot). In my exposition for this I had mentioned a mythical operator '?' or '+' or something which did this. Turns out this PR provides exactly that, calling it '^'.

I first mentioned this in the context of the work I'm doing in https://pagure.io/packaging-committee/issue/398#comment-540026 and also in my notes for the use of tilde in https://fedoraproject.org/wiki/User:Tibbs/TildeVersioning#Conceptual_issues_with_tilde

@pmatilai also indirectly mentions this in https://pagure.io/packaging-committee/issue/398#comment-540133 and mentions that it can be hacked around by adding random zeroes. Though in reality, you would have to add multiple zeroes to truly avoid conflicts.

So, while lack of this isn't going to stop the current effort to implement tilde, it would certainly simplify things if we had it.

@Conan-Kudo
Copy link
Member

@ignatenkobrain I'm not against this, I'm just sad that bad versioning is a thing.

@hroncok
Copy link
Contributor

hroncok commented Nov 15, 2018

Also, as for the reason this was closed:

looks like Fedora is going for a policy that works with the current version compare ... I do not really see an immediate need for this

Note that when creating Fedora policies and guidelines, the FPC is forced to make it work with the current version compare (current anything generally), otherwise the policy cannot be used, as it would not work.

If we have this, we can make the policy far simpler. Please reconsider applying this.

@pmatilai
Copy link
Member

I can't reopen this, perhaps because the original branch was deleted. Anyway, I'm at least willing to discuss and certainly not directly opposed if somebody wants to open a new PR. Not because Fedora this or that but because I think symmetry makes sense: if we have a way force sorting one way, then why not the other way too?

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.

6 participants