GNU bug report logs - #28446
linux-libre@4.1 should select 4.1.x, not 4.13.x

Previous Next

Package: guix;

Reported by: Mark H Weaver <mhw <at> netris.org>

Date: Wed, 13 Sep 2017 15:08:01 UTC

Severity: normal

Done: ludo <at> gnu.org (Ludovic Courtès)

Bug is archived. No further changes may be made.

Full log


Message #17 received at 28446 <at> debbugs.gnu.org (full text, mbox):

From: Mark H Weaver <mhw <at> netris.org>
To: Ricardo Wurmus <rekado <at> elephly.net>
Cc: 28446 <at> debbugs.gnu.org
Subject: Re: bug#28446: linux-libre <at> 4.1 should select 4.1.x, not 4.13.x
Date: Tue, 26 Sep 2017 00:26:15 -0400
Hi Ricardo,

Ricardo Wurmus <rekado <at> elephly.net> writes:

>> Currently, the package specification "linux-libre <at> 4.1" 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.

One possible approach would be as follows: if the last character of the
specification is a digit, then priority should be given to versions that
have a non-digit (or end-of-string) after the last matching character.

Put another way, if the provided specification {SPEC} ends with a digit,
then we should first search based on the following regexp:

  ^{SPEC}[^0-9]

if no matches are found, then fall back to:

  ^{SPEC}

This would gracefully handle the common case where groups of adjacent
digits should be considered as single numbers, while still allowing
prefixes of other numeric components such as dates or commit ids.

I admit that this proposal lacks elegance.  So far I have no better
ideas.

      Mark




This bug report was last modified 7 years and 68 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.