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.bugs Subject: bug#60155: 29.0.60; package-vc doesn't detect subdirectories when installing from repositories Date: Sun, 25 Dec 2022 10:22:24 +0000 Message-ID: <87y1qvye8v.fsf@posteo.net> References: <87ilia4615.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="11903"; mail-complaints-to="usenet@ciao.gmane.io" To: 60155-done@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Dec 25 11:23:27 2022 Return-path: Envelope-to: geb-bug-gnu-emacs@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 1p9OAB-0002yk-6h for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 25 Dec 2022 11:23:27 +0100 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1p9O9o-0003hN-IN; Sun, 25 Dec 2022 05:23:04 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1p9O9m-0003ga-S2 for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 05:23:03 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1p9O9m-0005bf-IN for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 05:23:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1p9O9m-0007E8-Dc for bug-gnu-emacs@gnu.org; Sun, 25 Dec 2022 05:23:02 -0500 Resent-From: Philip Kaludercic Original-Sender: "Debbugs-submit" Resent-To: bug-gnu-emacs@gnu.org Resent-Date: Sun, 25 Dec 2022 10:23:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: cc-closed 60155 X-GNU-PR-Package: emacs Mail-Followup-To: 60155@debbugs.gnu.org, philipk@posteo.net, philipk@posteo.net Original-Received: via spool by 60155-done@debbugs.gnu.org id=D60155.167196374827705 (code D ref 60155); Sun, 25 Dec 2022 10:23:02 +0000 Original-Received: (at 60155-done) by debbugs.gnu.org; 25 Dec 2022 10:22:28 +0000 Original-Received: from localhost ([127.0.0.1]:47593 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9O9E-0007Cn-90 for submit@debbugs.gnu.org; Sun, 25 Dec 2022 05:22:28 -0500 Original-Received: from mout02.posteo.de ([185.67.36.66]:36457) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1p9O9C-0007CV-8Y for 60155-done@debbugs.gnu.org; Sun, 25 Dec 2022 05:22:27 -0500 Original-Received: from submission (posteo.de [185.67.36.169]) by mout02.posteo.de (Postfix) with ESMTPS id 3C1BF2402EA for <60155-done@debbugs.gnu.org>; Sun, 25 Dec 2022 11:22:20 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017; t=1671963740; bh=egWnh0uh0hAPjhFtxON44xpa6vTm99sJmOHANrOiHi0=; h=From:To:Subject:Date:From; b=I3IrnTaqJmNdhRFvaM8B4RMe6s2PRG72LNMx6iZHnanCA2tD2noQ2k63/v6U2AuZd WrfxPx9jtPWg29JvLUakzL1fTYgC39XuGxDJk1xApVuU7golGS1RuFG89B3tmn6GYi wVwCLvJwbw0bD9FsxprYyHXWoR/Dp2j2lwnU2/CRo4t/id6bN3WhJGjb/Jadxpekqk mD65lmbeLo0kqXafUG0nmB6UUmH+63g+JPOAgSjsFVr0yk4zrL++Gp+s4F7RjigZqh d8toG9JqA0cTIKDTcLdZK2rS6+Zwh8gOKVx3MI1j4DZldth9ivKI6J2N1sfR9FyJx1 3nv1GVd+w+kZA== Original-Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Nfxmq57Mvz6tmV for <60155-done@debbugs.gnu.org>; Sun, 25 Dec 2022 11:22:18 +0100 (CET) In-Reply-To: <87ilia4615.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 17 Dec 2022 11:35:18 +0000") X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list 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-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:251846 Archived-At: Philip Kaludercic writes: > M-x package-vc-install RET https://codeberg.org/martianh/mastodon.el RET > > This will fetch the package sources, but since the actual code is > located in a "lisp" subdirectory, none of the actual files will be added > to the load-path, making it appear as tough nothing were installed. > > This could be fixed by adding a heuristic to package-vc--unpack-1 that > checks if there is a ./lisp/ directory (with .el files?) and that would > add that to the load-path. Are there any other directory names or > structures that should be considered as well? Is it common for packages > to have loadable files in both the root directory of a repository and a > sub-directory? > > I could imagine that this would be enough to resolve the issue: > > diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el > index 8f0eedd2f8..eea5ad6c26 100644 > --- a/lisp/emacs-lisp/package-vc.el > +++ b/lisp/emacs-lisp/package-vc.el > @@ -443,6 +443,12 @@ package-vc--unpack-1 > (auto-name (format "%s-autoloads.el" name)) > (extras (package-desc-extras pkg-desc)) > (lisp-dir (alist-get :lisp-dir extras))) > + ;; Heuristic to guess a sub-directory with lisp files. > + (when-let (((null lisp-dir)) > + (dir (expand-file-name "lisp" pkg-dir)) > + ((file-directory-p dir))) > + (setq lisp-dir dir)) > + > (package-generate-autoloads > name (file-name-concat pkg-dir lisp-dir)) > (when lisp-dir I have installed a variation upon this diff in n06368fef. Please report if this heuristic is too aggressive.