Subject: Re: bug#28446: [email-masked] should select 4.1.x, not 4.13.x

From: Chris Marusich <[email-masked]>
Date: Thu, 21 Sep 2017 18:53:58 -0700

Ricardo Wurmus <[email-masked]> writes:

> Hi Mark,
>
>> Currently, the package specification "[email-masked]" selects version
>> 4.13.  It should instead select version 4.1.
>
> We consider everthing following the “@” a version string prefix.  Since
> versions are arbitrary strings “4.1” is considered a valid prefix of
> “4.13”.  If a user supplied the version string “4.1.” they would get the
> appropriate package.
>
> The current implementation sorts all matches in decreasing version order
> and picks the package with the highest version.  This is implemented in
> (gnu packages) with “%find-packages”, “find-best-packages-by-name”, and
> “find-packages-by-name”.
>
> Should we try to make the code understand version strings better and
> compare substrings of the version string?  We could fall back to using
> “string-prefix?” when the substring is not a number.
>

Why not require an exact match?  If someone asks for 4.1, they shouldn't
get 4.11 or 4.13 or anything else; they should get 4.1.  In my
experience, mechanisms that attempt to guess which package version the
user meant generally wind up choosing the wrong thing at some point.  I
think it would be reasonable to bail out and ask the user to clarify
what they wanted.

-- 
Chris