From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#22046: [PATCH] Improve version-to-list parsing Date: Mon, 30 Nov 2015 17:50:24 +0200 Message-ID: <83r3j7mqpr.fsf@gnu.org> References: <83y4dgma7k.fsf@gnu.org> Reply-To: Eli Zaretskii NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-Trace: ger.gmane.org 1448898751 732 80.91.229.3 (30 Nov 2015 15:52:31 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 30 Nov 2015 15:52:31 +0000 (UTC) Cc: 22046@debbugs.gnu.org To: Alex Dunn Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Nov 30 16:52:18 2015 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1a3QkN-0000i6-55 for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Nov 2015 16:52:11 +0100 Original-Received: from localhost ([::1]:41676 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3QkM-0002WW-Jx for geb-bug-gnu-emacs@m.gmane.org; Mon, 30 Nov 2015 10:52:10 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:47166) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3QkI-0002Rv-Gb for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2015 10:52:07 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1a3QkE-0003l3-FV for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2015 10:52:06 -0500 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43321) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1a3QkE-0003kz-Bs for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2015 10:52:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1a3QkE-0002M5-74 for bug-gnu-emacs@gnu.org; Mon, 30 Nov 2015 10:52:02 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 30 Nov 2015 15:52:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 22046 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 22046-submit@debbugs.gnu.org id=B22046.14488987159039 (code B ref 22046); Mon, 30 Nov 2015 15:52:02 +0000 Original-Received: (at 22046) by debbugs.gnu.org; 30 Nov 2015 15:51:55 +0000 Original-Received: from localhost ([127.0.0.1]:33029 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3Qk7-0002Lj-43 for submit@debbugs.gnu.org; Mon, 30 Nov 2015 10:51:55 -0500 Original-Received: from mtaout24.012.net.il ([80.179.55.180]:53077) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1a3Qjm-0002LB-9W for 22046@debbugs.gnu.org; Mon, 30 Nov 2015 10:51:53 -0500 Original-Received: from conversion-daemon.mtaout24.012.net.il by mtaout24.012.net.il (HyperSendmail v2007.08) id <0NYM00300WRCEC00@mtaout24.012.net.il> for 22046@debbugs.gnu.org; Mon, 30 Nov 2015 17:43:18 +0200 (IST) Original-Received: from HOME-C4E4A596F7 ([84.94.185.246]) by mtaout24.012.net.il (HyperSendmail v2007.08) with ESMTPA id <0NYM00MLYX05WW50@mtaout24.012.net.il>; Mon, 30 Nov 2015 17:43:17 +0200 (IST) In-reply-to: X-012-Sender: halo1@inter.net.il X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:109445 Archived-At: > From: Alex Dunn > 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.