Version comparison of ports

Jeff Johnson n3npq at mac.com
Fri Aug 12 07:39:35 PDT 2011


On Aug 12, 2011, at 10:25 AM, Anders F Björklund wrote:

> 
> The proposed change was more about changing the digits-beat-alpha option,
> than introducing more weird changes like tildes and distepochs, but anyway.
> 

For the narrow context of digits-beat-alpha, I'd suggest simpler-is-better,
and disabling digits-beat-alpha (which I believe is what you suggested).

(for others)

Versions are split into alpha and digit strings, which are
compared using either strcmp (for alphas) or leading 0 digit padded
(for digits).

The split into alpha/digit strings forces a conventional choice
	What is the result of alpha <-> digit string inter-comparison?
and digits-beat-alphas is unnatural (wrto ASCII ordering).

The incidence of alpha <-> digit comparison is vanishingly small
in MacPorts. The need for the unnaturalness comes iff some vendor
(like Mandrake) insists on appending a "branding" string everywhere
in versions and wishes a reversed comparison.

Adding an extra twiddle breaks comparisons further; reverting
to simpler ASCII ordering for conventionally defined alpha <-> digit
comparison is simpler.

hth

73 de Jeff




More information about the macports-dev mailing list