Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Fri, Aug 11, 2006 at 10:42:53AM +1000, Matthew Palmer wrote: > On Thu, Aug 10, 2006 at 07:47:36PM -0400, Roberto C. Sanchez wrote: >> On Fri, Aug 11, 2006 at 01:29:40AM +0200, Adeodato Simó wrote: >>> * Michael Biebl [Fri, 11 Aug 2006 01:12:59 +0200]: that "dpkg --compare-versions '0.09' '=' '0.9'" yields true, which I think is rather odd, >>> 0.09 = 0.9 means: >>> 0 == 0 >>> and >>> . == . >>> and >>> 09 == 9 >>> >>> Which is pretty standard math. ;-) >> Except that the final comparison ignores that the number was to the >> right of the decimal, making the zero significant. I think you >> will be hard pressed to find a mathematician who supports dropping >> significant zeros for no good reason. > I'd imagine you'd be hard pressed to find a mathematician who knows > what to do with a number that reads 0.0.9, either. Well, I have found one. Myself. You just have to interpret the part after the second point as the integer part of an infinitesimal: Let ε be an infinitesimal, that is a strictly positive number (that is ε > 0) smaller than any strictly positive real number (that is ∀ n ∈ ℕ, n>0 implies ε < 1/n ). Then the version number x.y.z is interpreted as: x.y + z * ε (And a.b.c.d is interpreted as a.b + c.d * ε) Before anyone asks, yes I can go on for as many dots as you want. I just introduce a η that is strictly positive, yet strictly smaller than any ε/n for n ∈ ℕ, and I have up to five dots (six components). There are probably several ways to construct suitable ε and η and beyond, but presenting one of them is off-topic; I can present at least one of them to interested persons (Conway surreal numbers). Actually, in the Conway surreal numbers formalism, ε² would be a suitable η, but one can do better (a η that is smaller than any power of ε, yet strictly positive). One can also take the problem the other way round and use very big numbers instead of very small ones (for example the א hierarchy); the order is much less natural then, though. -- Lionel -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
Michael Biebl writes ("dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]"): > Reading this announcement I thought, great and wanted to start using > '~', only to discover that dpkg believes that 0.09+0.1.svn > 0.1~svn. > 1.) Wait for a 0.10 release. I think my users wouldn't be happy ;-) So you think that 0.09 < 0.1 ? But you also think that 0.10 > 0.1 ? And you talk about a 0.10 upstream release, which I assume you know will come after a 0.9 upstream release. So in your universe 0.09 < 0.1 < 0.9 < 0.10 ? Whatever that is, it's not arithmetic :-). > 2.) Use an epoch. There is no need for that; you can have ugly version numbers for a bit until 0.10 does come out. In the meantime 0.09+really+0.1~svn or whatever. Ian. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Fri, Aug 11, 2006 at 08:30:45AM +0100, martin f krafft wrote: > also sprach Michael Biebl <[EMAIL PROTECTED]> [2006.08.11.0012 +0100]: > > 1.) Wait for a 0.10 release. I think my users wouldn't be happy ;-) > > Why not continue to current versioning scheme until 0.10 is out to > avoid the epoch? Yeah -- and the improvement between 0.09+0.1.svn and 0.1~svn isn't big enough to warrant an upload anyway. The former is much nicer than 1:0.1~svn, too. -- 1KB // Microsoft corollary to Hanlon's razor: // Never attribute to stupidity what can be // adequately explained by malice. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
also sprach Michael Biebl <[EMAIL PROTECTED]> [2006.08.11.0012 +0100]: > 1.) Wait for a 0.10 release. I think my users wouldn't be happy ;-) Why not continue to current versioning scheme until 0.10 is out to avoid the epoch? -- Please do not send copies of list mail to me; I read the list! .''`. martin f. krafft <[EMAIL PROTECTED]> : :' :proud Debian developer and author: http://debiansystem.info `. `'` `- Debian - when you have better things to do than fixing a system "i like young girls. their stories are shorter." -- tom mcguane signature.asc Description: Digital signature (GPG/PGP)
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Thu, Aug 10, 2006 at 08:47:14PM -0400, Roberto C. Sanchez wrote: > On Fri, Aug 11, 2006 at 10:42:53AM +1000, Matthew Palmer wrote: > > > > I'd imagine you'd be hard pressed to find a mathematician who knows what to > > do with a number that reads 0.0.9, either. That's why we're software > > developers, not mathematicians. > > > > Or, to put it another way: your numbers are not our numbers. > > I never said I was a mathematician :-) The royal 'your', though. > The original comparison, though, was 0.09 and 0.9. We're out to break *all* the rules. If we need to make up a new evaluation algorithm to be able to handle 0.0.1, we may as well include handling zero-padding differently as well. - Matt -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Fri, Aug 11, 2006 at 10:42:53AM +1000, Matthew Palmer wrote: > > I'd imagine you'd be hard pressed to find a mathematician who knows what to > do with a number that reads 0.0.9, either. That's why we're software > developers, not mathematicians. > > Or, to put it another way: your numbers are not our numbers. > I never said I was a mathematician :-) The original comparison, though, was 0.09 and 0.9. -Roberto -- Roberto C. Sanchez http://familiasanchez.net/~roberto signature.asc Description: Digital signature
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Thu, Aug 10, 2006 at 08:37:47PM -0400, Roberto C. Sanchez wrote: > On Fri, Aug 11, 2006 at 02:21:04AM +0200, Adeodato Simó wrote: > > * Roberto C. Sanchez [Thu, 10 Aug 2006 19:47:36 -0400]: > > > > > Except that the final comparison ignores that the number was to the > > > right of the decimal, making the zero significant. > > > > Er, read Policy 5.6.12. > > > I have read it. I was simply speaking from a mathematical perspective. But a mathematical perspective is wrong, because it does not tell how to interpret 1.1.1 Version numbers are not floats. -- Rodrigo Gallardo GPG-Fingerprint: 7C81 E60C 442E 8FBC D975 2F49 0199 8318 ADC9 BC28 signature.asc Description: Digital signature
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Thu, Aug 10, 2006 at 07:47:36PM -0400, Roberto C. Sanchez wrote: > On Fri, Aug 11, 2006 at 01:29:40AM +0200, Adeodato Simó wrote: > > * Michael Biebl [Fri, 11 Aug 2006 01:12:59 +0200]: > > > > > that "dpkg --compare-versions '0.09' '=' '0.9'" yields true, which I > > > think is rather odd, because it means that now all version numbers up to > > > 0.9 will be considered < 0.09+0.1. > > > > 0.09 = 0.9 means: > > > > 0 == 0 > > and > > . == . > > and > > 09 == 9 > > > > Which is pretty standard math. ;-) > > > Except that the final comparison ignores that the number was to the > right of the decimal, making the zero significant. I think you will be > hard pressed to find a mathematician who supports dropping significant > zeros for no good reason. I'd imagine you'd be hard pressed to find a mathematician who knows what to do with a number that reads 0.0.9, either. That's why we're software developers, not mathematicians. Or, to put it another way: your numbers are not our numbers. - Matt
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Fri, Aug 11, 2006 at 02:21:04AM +0200, Adeodato Simó wrote: > * Roberto C. Sanchez [Thu, 10 Aug 2006 19:47:36 -0400]: > > > Except that the final comparison ignores that the number was to the > > right of the decimal, making the zero significant. > > Er, read Policy 5.6.12. > I have read it. I was simply speaking from a mathematical perspective. -Roberto -- Roberto C. Sanchez http://familiasanchez.net/~roberto signature.asc Description: Digital signature
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
* Roberto C. Sanchez [Thu, 10 Aug 2006 19:47:36 -0400]: > Except that the final comparison ignores that the number was to the > right of the decimal, making the zero significant. Er, read Policy 5.6.12. -- Adeodato Simó dato at net.com.org.es Debian Developer adeodato at debian.org Old men are fond of giving good advice to console themselves for their inability to set a bad example. -- La Rochefoucauld, "Maxims" -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Fri, Aug 11, 2006 at 01:12:59AM +0200, Michael Biebl wrote: > I have to admit that when choosing 0.09+0.1 as version number I didn't > check with dpkg --compare-versions because then I would have discovered > that "dpkg --compare-versions '0.09' '=' '0.9'" yields true, which I > think is rather odd, because it means that now all version numbers up to > 0.9 will be considered < 0.09+0.1. > > So, what should I do now: > 1.) Wait for a 0.10 release. I think my users wouldn't be happy ;-) > 2.) Use an epoch. > 3.) File a bug report against dpkg. > > If it's not a bug in dpkg, could someone please elaborate on the > reasoning of this behaviour. I'd be grateful for any comments and replies. Oooh, oooh! I know the answer to this! Having recently written a program to do quite detailed things with package version numbers, I've gotten intimately familiar with Policy s5.6.12. Specifically, 09 == 9 because "The numerical values of these two parts are compared" (3rd last paragraph), so leading zeroes are effectively stripped before comparison. I don't think it's a bug in dpkg or policy, realistically speaking -- the old practice of "0.01" versioning is pretty weird in general (periods are cheap, just make it 0.0.1 instead), and numeric sorting is much better in the general case (would you want 9 gt 10 == true?) but it just happens to have bitten you here. I think you're up for an epoch. - Matt -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Fri, Aug 11, 2006 at 01:29:40AM +0200, Adeodato Simó wrote: > * Michael Biebl [Fri, 11 Aug 2006 01:12:59 +0200]: > > > that "dpkg --compare-versions '0.09' '=' '0.9'" yields true, which I > > think is rather odd, because it means that now all version numbers up to > > 0.9 will be considered < 0.09+0.1. > > 0.09 = 0.9 means: > > 0 == 0 > and > . == . > and > 09 == 9 > > Which is pretty standard math. ;-) > Except that the final comparison ignores that the number was to the right of the decimal, making the zero significant. I think you will be hard pressed to find a mathematician who supports dropping significant zeros for no good reason. -Roberto -- Roberto C. Sanchez http://familiasanchez.net/~roberto signature.asc Description: Digital signature
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
On Fri, 11 Aug 2006 01:12:59 +0200, Michael Biebl <[EMAIL PROTECTED]> said: [...] > If it's not a bug in dpkg, could someone please elaborate on the > reasoning of this behaviour. I'd be grateful for any comments and > replies. It's documented in Policy 5.6.12 [1]. Substrings composed of digits are compared numerically, and so 09 == 9. (This is done to ensure that 10 > 9, for example.) [1] http://www.debian.org/doc/debian-policy/ch-controlfields.html#s-f-Version So I guess your only real option is to use an epoch. -- Hubert Chan - email & Jabber: [EMAIL PROTECTED] - http://www.uhoreg.ca/ PGP/GnuPG key: 1024D/124B61FA (Key available at wwwkeys.pgp.net) Fingerprint: 96C5 012F 5F74 A5F7 1FF7 5291 AF29 C719 124B 61FA -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]
Re: dpkg doing wrong math (0.09 = 0.9) ?- [was: dak now supports ~ in version numbers]
* Michael Biebl [Fri, 11 Aug 2006 01:12:59 +0200]: > that "dpkg --compare-versions '0.09' '=' '0.9'" yields true, which I > think is rather odd, because it means that now all version numbers up to > 0.9 will be considered < 0.09+0.1. 0.09 = 0.9 means: 0 == 0 and . == . and 09 == 9 Which is pretty standard math. ;-) > If it's not a bug in dpkg, could someone please elaborate on the > reasoning of this behaviour. I'd be grateful for any comments and replies. Well, don't know about the reasoning, but it's definitely not a dpkg bug, since it follows the comparison algorithm as described in Policy 5.6.12. The bottom line is: whenver dealing with version, never ever say "X is obviously greater than Y", and always run dpkg --compare-versions in advance. > 2.) Use an epoch. 1:0.1 is obviously (heh) >> 0.09. On other news, 1E0.1 is _also_ >> 0.9, but << 1.0. (Yes, this is called abuse.) Cheers, -- Adeodato Simó dato at net.com.org.es Debian Developer adeodato at debian.org One of my most productive days was throwing away 1000 lines of code. -- Ken Thompson -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]