From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Philip Kaludercic Newsgroups: gmane.emacs.devel Subject: Re: feature/package+vc 04c4c578c7 3/4: Allow for packages to be installed directly from VCS Date: Sun, 16 Oct 2022 22:18:18 +0000 Message-ID: <87edv72z11.fsf@posteo.net> References: <164484721900.31751.1453162457552427931@vcs2.savannah.gnu.org> <20220214140020.04438C00891@vcs2.savannah.gnu.org> <87bkqmqpvb.fsf@posteo.net> <871qris3xb.fsf@gnus.org> <877d1aqoc1.fsf@posteo.net> <87edvhqdrb.fsf@gnus.org> <871qrh2hh6.fsf@posteo.net> <87mta5oyec.fsf@gnus.org> <87sfjx10x1.fsf@posteo.net> <875ygsp0ng.fsf@gnus.org> <87h70c9bu4.fsf@posteo.net> <874jw73cjy.fsf@posteo.net> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25962"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , emacs-devel@gnu.org To: Lars Ingebrigtsen Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Mon Oct 17 00:24:58 2022 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 1okC42-0006Xs-A6 for ged-emacs-devel@m.gmane-mx.org; Mon, 17 Oct 2022 00:24:58 +0200 Original-Received: from localhost ([::1]:48090 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1okC40-0006aM-U2 for ged-emacs-devel@m.gmane-mx.org; Sun, 16 Oct 2022 18:24:57 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:52966) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okBxm-00008Q-G9 for emacs-devel@gnu.org; Sun, 16 Oct 2022 18:18:35 -0400 Original-Received: from mout02.posteo.de ([185.67.36.66]:38531) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1okBxj-0000FF-Ja for emacs-devel@gnu.org; Sun, 16 Oct 2022 18:18:30 -0400 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 52879240101 for ; Mon, 17 Oct 2022 00:18:23 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1665958703; bh=DounAt43VruSVrCzfVwRkBqgHQXxVtXIlrDSJqNhtoI=; h=From:To:Cc:Subject:Autocrypt:Date:From; b=bLPtjtxa1dy8TMrTfyxyfpKC//jOCw00HM8IMwow/V1OjYPdHINw+3YGNn6rt96Ym CaabZT55z1KKBEI6RpeGGZJA7tjcBvxdIJVpnv5S0sFUCUSBlJ7Pw4bTqeVNTYj/le byURnxks6WwgLKrjQgVXLmOSeIb70z9g271MlY7BEvn1HX8oN3TSsDndXKyqJABba1 y+PaGVEe0akKW/a1GUUYIwLbYUHeCUOFMhNrBufX3BP5AxN0MgxsGm4+9B/8DDhWry 4g3NSAQh0emUvfAcECd9cRusrj5E//aw5jDLVdZbNWthXUgKalRcL55k/0J3UZijnJ +8QfgxUj6w00w== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4MrDzL1dz9z9rxP; Mon, 17 Oct 2022 00:18:19 +0200 (CEST) In-Reply-To: <874jw73cjy.fsf@posteo.net> (Philip Kaludercic's message of "Thu, 13 Oct 2022 18:37:05 +0200") Autocrypt: addr=philipk@posteo.net; prefer-encrypt=nopreference; keydata= mDMEYHHqUhYJKwYBBAHaRw8BAQdAp3GdmYJ6tm5McweY6dEvIYIiry+Oz9rU4MH6NHWK0Ee0QlBo aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0 ZW8ubmV0PoiQBBMWCAA4FiEEDM2H44ZoPt9Ms0eHtVrAHPRh1FwFAmBx6lICGwMFCwkIBwIGFQoJ CAsCBBYCAwECHgECF4AACgkQtVrAHPRh1FyTkgEAjlbGPxFchvMbxzAES3r8QLuZgCxeAXunM9gh io0ePtUBALVhh9G6wIoZhl0gUCbQpoN/UJHI08Gm1qDob5zDxnIHuDgEYHHqUhIKKwYBBAGXVQEF AQEHQNcRB+MUimTMqoxxMMUERpOR+Q4b1KgncDZkhrO2ql1tAwEIB4h4BBgWCAAgFiEEDM2H44Zo Pt9Ms0eHtVrAHPRh1FwFAmBx6lICGwwACgkQtVrAHPRh1Fw1JwD/Qo7kvtib8jy7puyWrSv0MeTS g8qIxgoRWJE/KKdkCLEA/jb9b9/g8nnX+UcwHf/4VfKsjExlnND3FrBviXUW6NcB Received-SPF: pass client-ip=185.67.36.66; envelope-from=philipk@posteo.net; helo=mout02.posteo.de X-Spam_score_int: -43 X-Spam_score: -4.4 X-Spam_bar: ---- X-Spam_report: (-4.4 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham 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:297887 Archived-At: --=-=-= Content-Type: text/plain Here is a patch that would add all the necessary metadata for package-vc to work to ELPA: --=-=-= Content-Type: text/x-patch Content-Disposition: inline; filename=0001-Add-package-vc-to-package-metadata.patch >From 98ac710ca97ebca5be1f9bf49b40a701c541b21d Mon Sep 17 00:00:00 2001 From: Philip Kaludercic Date: Mon, 17 Oct 2022 00:05:17 +0200 Subject: [PATCH] Add 'package-vc' to package metadata * elpa-admin.el (elpaa--metadata): Add :upstream property. --- elpa-admin.el | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/elpa-admin.el b/elpa-admin.el index 054c9bda86..f22c345cd9 100644 --- a/elpa-admin.el +++ b/elpa-admin.el @@ -1074,6 +1074,18 @@ PKG is the name of the package and DIR is the directory where it is." (unless found-url ;; Provide a good default URL. (push (cons :url (elpaa--default-url pkg)) extras)) + ;; Add `package-vc' data + (let ((spec (cdr pkg-spec)) + (ups (list :upstream 'Git nil nil nil))) + (if (null (plist-get spec :url)) + (setf (nth 2 ups) (concat "https://git.savannah.gnu.org/git/" + elpaa--gitrepo) + (nth 3 ups) (plist-get spec :lisp-dir) + (nth 4 ups) (concat elpaa--branch-prefix pkg)) + (setf (nth 2 ups) (plist-get spec :url) + (nth 3 ups) (plist-get spec :lisp-dir) + (nth 4 ups) (plist-get spec :branch))) + (push ups extras)) (list simple (package-version-join version) (package-desc-summary pkg-desc) -- 2.38.0 --=-=-= Content-Type: text/plain This does not special optimisation to minimise the data. I guess this is also a good point to hear objections to the current way the VC data is handled. Here is an example entry from "archive-contents", note the new `:upstream' entry in the metadata field (the last element of the vector): --8<---------------cut here---------------start------------->8--- (setup . [(1 3 0) ((emacs (26 1))) "Helpful Configuration Macro" tar ((:url . "https://git.sr.ht/~pkal/setup") (:keywords "lisp" "local") (:maintainer "Philip Kaludercic" . "~pkal/public-inbox@lists.sr.ht") (:authors --> ("Philip Kaludercic" . "philipk@posteo.net")) (:upstream Git "https://git.sr.ht/~pkal/setup" nil nil) (:commit . "eece09d1151fd641f31d738b8c62742918993e95"))]) --8<---------------cut here---------------end--------------->8--- or --8<---------------cut here---------------start------------->8--- (smalltalk-mode . [(4 0) nil "Major mode for the GNU Smalltalk programming language" tar ((:maintainer "Derek Zhou" . "derek@3qin.us") (:url . "https://elpa.gnu.org/packages/smalltalk-mode.html") --> (:upstream Git "https://git.savannah.gnu.org/git/emacs/elpa.git" nil "externals/smalltalk-mode") (:commit . "570b705db9a02bb48cd61652639401715f419447"))]) --8<---------------cut here---------------end--------------->8--- The value corresponding to :upstream is a list of the form (VC-BACKEND REPOSITORY-URL SUBDIRECTORY BRANCH) I have been wondering if it would be better to use a {a,p}list instead, which would be more flexible if changes would become necessary in the future. Perhaps I am even missing something right now? At the same time I don't mean to burden the ELPA server by increasing the size of the file that is regularly queried. Perhaps REPOSITORY-URL could have special values such as `:url' to indicate that the package URL is the same as the repository and `:elpa'/`:nongnu' to indicate that the default repository is being used. Or is this just premature optimisation? --=-=-=--