From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: "Bozhidar Batsov" Newsgroups: gmane.emacs.devel Subject: Re: What's the right way to extract a package's version from the header metadata? Date: Wed, 29 Dec 2021 20:42:05 +0200 Message-ID: <7b3bc110-03c2-48d5-a56e-1a39edd37b0f@beta.fastmail.com> References: <87bl0zw9t3.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/alternative; boundary=3b970811628e44f9b0b5aaf0d471ed96 Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="28099"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Cyrus-JMAP/3.5.0-alpha0-4525-g8883000b21-fm-20211221.001-g8883000b To: "Emacs Devel" Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Wed Dec 29 19:46:01 2021 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n2dxX-00072A-OA for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Dec 2021 19:46:01 +0100 Original-Received: from localhost ([::1]:35666 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1n2dxW-00006U-Kj for ged-emacs-devel@m.gmane-mx.org; Wed, 29 Dec 2021 13:45:58 -0500 Original-Received: from eggs.gnu.org ([209.51.188.92]:38896) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2duC-0006ju-9A for emacs-devel@gnu.org; Wed, 29 Dec 2021 13:42:32 -0500 Original-Received: from wout5-smtp.messagingengine.com ([64.147.123.21]:37161) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1n2duA-0000xH-2t for emacs-devel@gnu.org; Wed, 29 Dec 2021 13:42:32 -0500 Original-Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id 940993200564 for ; Wed, 29 Dec 2021 13:42:28 -0500 (EST) Original-Received: from imap43 ([10.202.2.93]) by compute5.internal (MEProxy); Wed, 29 Dec 2021 13:42:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=batsov.dev; h= mime-version:message-id:in-reply-to:references:date:from:to :subject:content-type; s=fm2; bh=56IJOfHt5zLs4TZN/iIG7ufgbNAyw8g 1plrH2HRlHaI=; b=TccicY83BzUBK2YkoXnhiJZ+dRc/PYInAnneG+D2i6tSMKv lL0dW0Z2Tni5JW72FK8h5ca5FAWD8tlzIDDzAsTRWaXveZLiUGtaAhFLXKmWGHmX pWjYIBcY9d7YE50iCzoFtjpJJHoZej2gRm9xHoFqUxHF42p7yGXKYxKjIxxt+zjs xhO69qdwwDbErfB/aYyXRnHyxsXoX4PDzlyJBCSJjaStk69GVGSM+dc0LDiY4Y4I GqLLXdkOlAa1cOXnyo+f0BekHqkbb2m3m3L3vJO8sBSzfMd8fDW1XVPN/r5vY+pC kM+d6iKLm7VGRLuCieSOLlvrESK9nDytjiYRS9w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=56IJOf Ht5zLs4TZN/iIG7ufgbNAyw8g1plrH2HRlHaI=; b=iCNoRUeukgFt0ZDmxcEAeY gSgtISpIueSuYCpVY9w+9zMV5YuM0/uiQ7dOEsFYK/II8EGU5QmSoSOMzrA0pJ7a YfXm+zs5tFxKW5WG7Ru08VJPcJijX/olAWH6zeMs4xlFkZ0n3wQC2Zbd2vTlmbIq xqUE9vkLAMmvoSDaVNJnZ5oUU99uyw5BsDg4uia1dERlC3z03343dG6zeZYaIOZI Na6KK0Wz3Tqb/JRXfHYz7QdbvXOdErtb0rMU6AvOBshsYEwgdK1/ix4YssIitz3V 2BF/3FXGNvErku3N8UDGnG/E20DkJw6XtEmglVU4RIVp4jSb+KDZ6O9d0eXYHhag == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddruddvuddguddujecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpefofgggkfgjfhffhffvufgtsegrtderreerredtnecuhfhrohhmpedfueho iihhihgurghruceurghtshhovhdfuceosghoiihhihgurghrsegsrghtshhovhdruggvvh eqnecuggftrfgrthhtvghrnhepgedvteefkeekteeilefftdekuddthffffeegtdevhfet feevjefhgfdtkeejieeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepsghoiihhihgurghrsegsrghtshhovhdruggvvh X-ME-Proxy: Original-Received: by mailuser.nyi.internal (Postfix, from userid 501) id DAC7AAC0E99; Wed, 29 Dec 2021 13:42:27 -0500 (EST) X-Mailer: MessagingEngine.com Webmail Interface In-Reply-To: <87bl0zw9t3.fsf@posteo.net> Received-SPF: pass client-ip=64.147.123.21; envelope-from=bozhidar@batsov.dev; helo=wout5-smtp.messagingengine.com X-Spam_score_int: -8 X-Spam_score: -0.9 X-Spam_bar: / X-Spam_report: (-0.9 / 5.0 requ) DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:283586 Archived-At: --3b970811628e44f9b0b5aaf0d471ed96 Content-Type: text/plain I don't see how manually generating the pkg manifest will help; perhaps I'm missing the point you're trying to make. In the case of MELPA the version will always be overridden regardless of the presence of a package manifest, and in most of my packages I'm adding show-package-version command to help with the bug reports. It seems to me that package version extraction is a pretty common problem that deserves a simple solution. On Wed, Dec 29, 2021, at 8:22 PM, Thierry Volpiatto wrote: > Stefan Monnier writes: > > >> Basically I want to extract the package version from the *Version:* > >> header instead of having to duplicate it. I know of > >> package-get-package-version, but I assume it won't work for people > >> who didn't install my packages via package.el. > > > > `package-get-version` should work but only if they had the foresight to > > put it in a directory whose name ends in "-" or whose name is > > just `cider` (i.e. the name of your package) :-( > > Why doing this instead of adding such infos to *.pkg.el file of package? > IIRC package.el is creating such file from source file headers instead > of using the existing file if it exists (I already asked for this in the > past). > > -- > Thierry > > --3b970811628e44f9b0b5aaf0d471ed96 Content-Type: text/html Content-Transfer-Encoding: quoted-printable
I don't see how= manually generating the pkg manifest will help; perhaps I'm missing the= point you're trying to make. In the case of MELPA the version will alwa= ys be overridden regardless of the presence of a package manifest, and i= n most of my packages I'm adding show-package-version command to help wi= th the bug reports. It seems to me that package version extraction is a = pretty common problem that deserves a simple solution. 
<= div>
On Wed, Dec 29, 2021, at 8:22 PM, Thierry Volpiatto w= rote:
Stefa= n Monnier <monnier@iro.um= ontreal.ca> writes:

>> Basical= ly I want to extract the package version from the *Version:*
>>  header instead of having to duplicate it. I know of
>>  package-get-package-version, but I assume it = won't work for people
>>  who didn't install my= packages via package.el.  
>
&= gt; `package-get-version` should work but only if they had the foresight= to
> put it in a directory whose name ends in "-<ve= rsion>" or whose name is
> just `cider` (i.e. the na= me of your package) :-(

Why doing this inst= ead of adding such infos to *.pkg.el file of package?
IIRC= package.el is creating such file from source file headers instead
of using the existing file if it exists (I already asked for th= is in the
past).

-- 
=
Thierry


<= div>
--3b970811628e44f9b0b5aaf0d471ed96--