bug-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

bug#22046: [PATCH] Improve version-to-list parsing


From: Eli Zaretskii
Subject: bug#22046: [PATCH] Improve version-to-list parsing
Date: Mon, 30 Nov 2015 17:50:24 +0200

> From: Alex Dunn <dunn.alex@gmail.com>
> Cc: 22046@debbugs.gnu.org
> Date: Sun, 29 Nov 2015 19:54:18 -0800
> 
> I’d say in both cases “0.9” is the version and /alpha-?/ is the priority
> modifier, so if one is '(0 9 -3) then they both should be.
> 
> Two other options for dealing with these cases (while keeping
> “OTP-18.0.5” -> '(18 0 5)) is to just strip the /alpha-?/ and parse
> those strings as '(0 9) or flag them as invalid version-strings.  My
> ordered preferences are:
> 
> 1. parse them both as '(0 9 -3)
> 2. treat them as invalid and throw an error
> 3. parse them as '(0 9)

The original code indeed signals an error with both "alpha0.9" and
"alpha-0.9", as expected.

But I've just realized that this is a followup to a previous patch, so
let me step back and respond to that.

> This was prompted by an issue over at MELPA, where they were having
> trouble packaging stable versions of erlang-mode due to Erlang’s odd
> version-strings: https://github.com/milkypostman/melpa/issues/2553.  So
> with this patch, 'OTP-18.0.5' is valid and parsed as '(18 0 5).

Sorry, I don't understand the issue; can you clarify?  "OTP-18.0.5" is
not a valid version string, you are supposed to submit just the
"18.0.5" part to the Emacs version-handling facilities.  Why isn't
that being done here, or why cannot it be done?  Especially since the
changes you propose effectively ignore the "OTP-" part anyway, as they
indeed should: AFAIU, "OTP" has nothing to do with versioning.

Treating "SOMETHING-1.2.3" as a valid version string changes the rules
significantly, and IMO opens a Pandora box, as we suddenly need to be
able to recognize/allow words that have nothing to do with versioning,
as opposed to a few words (alpha, beta, CVS, etc.) that do.  I don't
think we should go that way without a very good reason and some
important use cases.

> - The docstring said “22.8X3” was invalid, when it actually was; it got
>    parsed as '(22 8 24 3).  I’ve made it really invalid.

This change in behavior is definitely worth making, thanks.





reply via email to

[Prev in Thread] Current Thread [Next in Thread]