Re: dpkg doing wrong math (0.09 = 0.9) ?-
Florian Weimer <fw@deneb.enyo.de> writes:
> "." is not special as far as version numbers are concerned. It's not
> a separator, for instance, and "1." is a valid version number (which
> is equal to "1.0").
That doesn't match my reading of Policy 5.6.12:
The strings are compared from left to right.
First the initial part of each string consisting entirely of
non-digit characters is determined. These two parts (one of which
may be empty) are compared lexically. If a difference is found it
is returned. The lexical comparison is a comparison of ASCII
values modified so that all the letters sort earlier than all the
non-letters.
Then the initial part of the remainder of each string which
consists entirely of digit characters is determined. The numerical
values of these two parts are compared, and any difference found
is returned as the result of the comparison. For these purposes an
empty string (which can only occur at the end of one or both
version strings being compared) counts as zero.
These two steps (comparing and removing initial non-digit strings
and initial digit strings) are repeated until a difference is
found or both strings are exhausted.
So any '.' between digits would be a "part of [the] string consisting
entirely of non-digit characters", and is compared lexically by ASCII
values; following which is a "part of the remainder of [the] string
which consists entirely of digit characters", and is compared
numerically; and we repeat these steps until the string is exhausted.
That sure sounds like a lone '.' between digit-sequences would be a
separator for those digit-sequences.
--
\ "Just because nobody complains doesn't mean all parachutes are |
`\ perfect." -- Benny Hill |
_o__) |
Ben Finney
Reply to: