From: Philip Kaludercic <philipk@posteo.net>
To: 60155-done@debbugs.gnu.org
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 [thread overview]
Message-ID: <87y1qvye8v.fsf@posteo.net> (raw)
In-Reply-To: <87ilia4615.fsf@posteo.net> (Philip Kaludercic's message of "Sat, 17 Dec 2022 11:35:18 +0000")
Philip Kaludercic <philipk@posteo.net> 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.
prev parent reply other threads:[~2022-12-25 10:22 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-17 11:35 bug#60155: 29.0.60; package-vc doesn't detect subdirectories when installing from repositories Philip Kaludercic
2022-12-25 10:22 ` Philip Kaludercic [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87y1qvye8v.fsf@posteo.net \
--to=philipk@posteo.net \
--cc=60155-done@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.