GNU bug report logs - #60155
29.0.60; package-vc doesn't detect subdirectories when installing from repositories

Previous Next

Package: emacs;

Reported by: Philip Kaludercic <philipk <at> posteo.net>

Date: Sat, 17 Dec 2022 11:36:02 UTC

Severity: normal

Found in version 29.0.60

Done: Philip Kaludercic <philipk <at> posteo.net>

Bug is archived. No further changes may be made.

Full log


Message #10 received at 60155-done <at> debbugs.gnu.org (full text, mbox):

From: Philip Kaludercic <philipk <at> posteo.net>
To: 60155-done <at> debbugs.gnu.org
Subject: Re: bug#60155: 29.0.60; package-vc doesn't detect subdirectories
 when installing from repositories
Date: Sun, 25 Dec 2022 10:22:24 +0000
Philip Kaludercic <philipk <at> 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.




This bug report was last modified 2 years and 186 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.