Re: [pacman-dev] vercomp test - Was: [GIT] The official pacman repository branch, master, updated. v3.1.4-182-gb48f703
On Thu, May 29, 2008 at 11:50 PM, Allan McRae <mcrae_allan@hotmail.com> wrote:
Dan McGee wrote:
On Thu, May 29, 2008 at 10:55 PM, Dan McGee <dpmcgee@gmail.com> wrote:
Let me know what you think of my latest working branch commit, this solves the original problem as well as makes the vercmptest.sh script a bit more powerful.
http://code.toofishes.net/gitweb.cgi?p=pacman.git;a=commitdiff;h=c574bfd8e3a...
Are these comparison really what is wanted? runtest 1.5 1.5-1 0 runtest 1.5-1 1.5 0 runtest 1.1-1 1.1 0
Yes, quite sure. First off, we have the old behavior, which matches the above. Second, we have the reason for the old behavior, which is that a depend can be specified as such: foobar<=1.5 and foobar 1.5-13 needs to meet this requirement (aka 1.5 cmp 1.5-13 should yield 0). So a pkgrel is no sign of being newer, only a sign of something different to compare, and not to be compared until the versions are identical.
I would have assumed the package with the pkgrel is newer. In the current situation version 1.5 is equivalent to 1.5-1, 1.5-2, 1.5-3, etc. I think this would be better:
} else if(*ptr1 == '-') { /* ptr1 has hit the pkgrel and ptr2 has not. * version 2 is newer iff we are not at the end of ptr2 */ - ret = *ptr2 ? -1 : 0; + ret = *ptr2 ? -1 : 1; goto cleanup; } else if(*ptr2 == '-') { /* ptr2 has hit the pkgrel and ptr1 has not. * version 1 is newer iff we are not at the end of ptr1 */ - ret = *ptr1 ? 1 : 0; + ret = *ptr1 ? 1 : -1; goto cleanup; }
Allan
On Fri, May 30, 2008 at 6:59 AM, Dan McGee <dpmcgee@gmail.com> wrote:
Yes, quite sure. First off, we have the old behavior, which matches the above. Second, we have the reason for the old behavior, which is that a depend can be specified as such: foobar<=1.5 and foobar 1.5-13 needs to meet this requirement (aka 1.5 cmp 1.5-13 should yield 0). So a pkgrel is no sign of being newer, only a sign of something different to compare, and not to be compared until the versions are identical.
That is all correct, but to be honest, I don't like much the ambiguity, obscurity and confusion caused by this, which would not happen if we only used versioned deps like : foobar <= 1.5-1 or foobar < 1.6-1
participants (2)
-
Dan McGee
-
Xavier