unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#69019: [PATCH] package-vc: scan the correct directory for lisp files
@ 2024-02-10 18:51 Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-02-11 12:48 ` Philip Kaludercic
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-02-10 18:51 UTC (permalink / raw)
  To: 69019

[-- Attachment #1: Type: text/plain, Size: 155 bytes --]


Following up on my previous patch (Bug#68761), we need to scan for
package requirements inside the lisp-dir (if set), not in the root
package directory.


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-package-vc-scan-the-correct-directory-for-lisp-files.patch --]
[-- Type: text/x-patch, Size: 2168 bytes --]

From 5a4540756e5e30d12010ce58094aafacc1b8fe01 Mon Sep 17 00:00:00 2001
From: Steven Allen <steven@stebalien.com>
Date: Sat, 10 Feb 2024 10:05:11 -0800
Subject: [PATCH] package-vc: scan the correct directory for lisp files

Otherwise, we won't correctly detect package requirements.

* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1):
  Scan 'lisp-dir', if set, for lisp files instead of scanning the root
  package directory.
---
 lisp/emacs-lisp/package-vc.el | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index fc402716dab..2730100b3d0 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -501,8 +501,9 @@ package-vc--unpack-1
 autoloads, generating a package description file (used to
 identify a package as a VC package later on), building
 documentation and marking the package as installed."
-  (let ((pkg-spec (package-vc--desc->spec pkg-desc))
-        missing)
+  (let* ((pkg-spec (package-vc--desc->spec pkg-desc))
+         (lisp-dir (plist-get pkg-spec :lisp-dir))
+         missing)
 
     ;; In case the package was installed directly from source, the
     ;; dependency list wasn't know beforehand, and they might have
@@ -519,7 +520,7 @@ package-vc--unpack-1
                 "\\|")
              regexp-unmatchable))
           (deps '()))
-      (dolist (file (directory-files pkg-dir t "\\.el\\'" t))
+      (dolist (file (directory-files (file-name-concat pkg-dir lisp-dir) t "\\.el\\'" t))
         (unless (string-match-p ignored-files file)
           (with-temp-buffer
             (insert-file-contents file)
@@ -542,8 +543,7 @@ package-vc--unpack-1
           (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir)))
       ;; Generate autoloads
       (let* ((name (package-desc-name pkg-desc))
-             (auto-name (format "%s-autoloads.el" name))
-             (lisp-dir (plist-get pkg-spec :lisp-dir)))
+             (auto-name (format "%s-autoloads.el" name)))
         (package-generate-autoloads
          name (file-name-concat pkg-dir lisp-dir))
         (when lisp-dir
-- 
2.43.0


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#69019: [PATCH] package-vc: scan the correct directory for lisp files
  2024-02-10 18:51 bug#69019: [PATCH] package-vc: scan the correct directory for lisp files Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-02-11 12:48 ` Philip Kaludercic
  2024-02-11 22:46   ` Steven Allen
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Kaludercic @ 2024-02-11 12:48 UTC (permalink / raw)
  To: Steven Allen; +Cc: 69019

Steven Allen <steven@stebalien.com> writes:

> Following up on my previous patch (Bug#68761), we need to scan for
> package requirements inside the lisp-dir (if set), not in the root
> package directory.

Looks good, do you have any specific examples where this caused
problems?

>>From 5a4540756e5e30d12010ce58094aafacc1b8fe01 Mon Sep 17 00:00:00 2001
> From: Steven Allen <steven@stebalien.com>
> Date: Sat, 10 Feb 2024 10:05:11 -0800
> Subject: [PATCH] package-vc: scan the correct directory for lisp files
>
> Otherwise, we won't correctly detect package requirements.
>
> * lisp/emacs-lisp/package-vc.el (package-vc--unpack-1):
>   Scan 'lisp-dir', if set, for lisp files instead of scanning the root
>   package directory.

Just note that the convention of the commit message logs is not to
indent the lines here.  I can take care of that.

> ---
>  lisp/emacs-lisp/package-vc.el | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
>
> diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
> index fc402716dab..2730100b3d0 100644
> --- a/lisp/emacs-lisp/package-vc.el
> +++ b/lisp/emacs-lisp/package-vc.el
> @@ -501,8 +501,9 @@ package-vc--unpack-1
>  autoloads, generating a package description file (used to
>  identify a package as a VC package later on), building
>  documentation and marking the package as installed."
> -  (let ((pkg-spec (package-vc--desc->spec pkg-desc))
> -        missing)
> +  (let* ((pkg-spec (package-vc--desc->spec pkg-desc))
> +         (lisp-dir (plist-get pkg-spec :lisp-dir))
> +         missing)
>  
>      ;; In case the package was installed directly from source, the
>      ;; dependency list wasn't know beforehand, and they might have
> @@ -519,7 +520,7 @@ package-vc--unpack-1
>                  "\\|")
>               regexp-unmatchable))
>            (deps '()))
> -      (dolist (file (directory-files pkg-dir t "\\.el\\'" t))
> +      (dolist (file (directory-files (file-name-concat pkg-dir lisp-dir) t "\\.el\\'" t))
>          (unless (string-match-p ignored-files file)
>            (with-temp-buffer
>              (insert-file-contents file)
> @@ -542,8 +543,7 @@ package-vc--unpack-1
>            (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir)))
>        ;; Generate autoloads
>        (let* ((name (package-desc-name pkg-desc))
> -             (auto-name (format "%s-autoloads.el" name))
> -             (lisp-dir (plist-get pkg-spec :lisp-dir)))
> +             (auto-name (format "%s-autoloads.el" name)))
>          (package-generate-autoloads
>           name (file-name-concat pkg-dir lisp-dir))
>          (when lisp-dir

-- 
Philip Kaludercic





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#69019: [PATCH] package-vc: scan the correct directory for lisp files
  2024-02-11 12:48 ` Philip Kaludercic
@ 2024-02-11 22:46   ` Steven Allen
  2024-02-12 17:45     ` Philip Kaludercic
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Allen @ 2024-02-11 22:46 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 69019


>> Following up on my previous patch (Bug#68761), we need to scan for
>> package requirements inside the lisp-dir (if set), not in the root
>> package directory.
>
> Looks good, do you have any specific examples where this caused
> problems?

pdf-tools puts all its files in a "lisp" dir, so they weren't getting
searched when scanning for dependencies. The package definition is:


    (:url "https://github.com/vedang/pdf-tools/pulls"
     :lisp-dir "lisp")

This patch causes package-vc to scan for dependencies in elisp files in
"$pkg-dir/lisp/", instead of looking for elisp files in "$pkg-dir/".

>> * lisp/emacs-lisp/package-vc.el (package-vc--unpack-1):
>>   Scan 'lisp-dir', if set, for lisp files instead of scanning the root
>>   package directory.
>
> Just note that the convention of the commit message logs is not to
> indent the lines here.  I can take care of that.

I did not, thanks!





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#69019: [PATCH] package-vc: scan the correct directory for lisp files
  2024-02-11 22:46   ` Steven Allen
@ 2024-02-12 17:45     ` Philip Kaludercic
  2024-02-12 18:07       ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 6+ messages in thread
From: Philip Kaludercic @ 2024-02-12 17:45 UTC (permalink / raw)
  To: Steven Allen; +Cc: 69019

[-- Attachment #1: Type: text/plain, Size: 874 bytes --]

(Don't forget to keep the bug tracker in the CC's; I have resent your
message so that everything remains in the archives)

Steven Allen <steven@stebalien.com> writes:

>>> Following up on my previous patch (Bug#68761), we need to scan for
>>> package requirements inside the lisp-dir (if set), not in the root
>>> package directory.
>>
>> Looks good, do you have any specific examples where this caused
>> problems?
>
> pdf-tools puts all its files in a "lisp" dir, so they weren't getting
> searched when scanning for dependencies. The package definition is:
>
>     (:url "https://github.com/vedang/pdf-tools/pulls"
>      :lisp-dir "lisp")
>
> This patch causes package-vc to scan for dependencies in elisp files in
> "$pkg-dir/lisp/", instead of looking for elisp files in "$pkg-dir/".

OK, I have slightly modified the commit, can you check if it still works
for you:


[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: 0001-Respect-lisp-dir-whilst-scanning-for-VC-package-depe.patch --]
[-- Type: text/x-patch, Size: 2271 bytes --]

From 4758889a51bbc87a330bf21c89745a7b49597119 Mon Sep 17 00:00:00 2001
From: Steven Allen <steven@stebalien.com>
Date: Sat, 10 Feb 2024 10:05:11 -0800
Subject: [PATCH] Respect :lisp-dir whilst scanning for VC package dependencies

* lisp/emacs-lisp/package-vc.el (package-vc--unpack-1):
Scan 'lisp-dir', if set, for lisp files instead of scanning the root
package directory.  (Bug#69019)
---
 lisp/emacs-lisp/package-vc.el | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)

diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index fc402716dab..37980c28b02 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -501,8 +501,10 @@ package-vc--unpack-1
 autoloads, generating a package description file (used to
 identify a package as a VC package later on), building
 documentation and marking the package as installed."
-  (let ((pkg-spec (package-vc--desc->spec pkg-desc))
-        missing)
+  (let* ((pkg-spec (package-vc--desc->spec pkg-desc))
+         (lisp-dir (plist-get pkg-spec :lisp-dir))
+         (lisp-path (file-name-concat pkg-dir lisp-dir))
+         missing)
 
     ;; In case the package was installed directly from source, the
     ;; dependency list wasn't know beforehand, and they might have
@@ -519,7 +521,7 @@ package-vc--unpack-1
                 "\\|")
              regexp-unmatchable))
           (deps '()))
-      (dolist (file (directory-files pkg-dir t "\\.el\\'" t))
+      (dolist (file (directory-files lisp-path t "\\.el\\'" t))
         (unless (string-match-p ignored-files file)
           (with-temp-buffer
             (insert-file-contents file)
@@ -542,10 +544,8 @@ package-vc--unpack-1
           (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir)))
       ;; Generate autoloads
       (let* ((name (package-desc-name pkg-desc))
-             (auto-name (format "%s-autoloads.el" name))
-             (lisp-dir (plist-get pkg-spec :lisp-dir)))
-        (package-generate-autoloads
-         name (file-name-concat pkg-dir lisp-dir))
+             (auto-name (format "%s-autoloads.el" name)))
+        (package-generate-autoloads name lisp-path)
         (when lisp-dir
           (write-region
            (with-temp-buffer
-- 
2.43.0


[-- Attachment #3: Type: text/plain, Size: 309 bytes --]


>>> * lisp/emacs-lisp/package-vc.el (package-vc--unpack-1):
>>>   Scan 'lisp-dir', if set, for lisp files instead of scanning the root
>>>   package directory.
>>
>> Just note that the convention of the commit message logs is not to
>> indent the lines here.  I can take care of that.
>
> I did not, thanks!

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* bug#69019: [PATCH] package-vc: scan the correct directory for lisp files
  2024-02-12 17:45     ` Philip Kaludercic
@ 2024-02-12 18:07       ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2024-02-13 21:07         ` Philip Kaludercic
  0 siblings, 1 reply; 6+ messages in thread
From: Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2024-02-12 18:07 UTC (permalink / raw)
  To: Philip Kaludercic; +Cc: 69019


Philip Kaludercic <philipk@posteo.net> writes:
> OK, I have slightly modified the commit, can you check if it still works
> for you:

Tested and confirmed working. And thanks for CCing the list.





^ permalink raw reply	[flat|nested] 6+ messages in thread

* bug#69019: [PATCH] package-vc: scan the correct directory for lisp files
  2024-02-12 18:07       ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2024-02-13 21:07         ` Philip Kaludercic
  0 siblings, 0 replies; 6+ messages in thread
From: Philip Kaludercic @ 2024-02-13 21:07 UTC (permalink / raw)
  To: Steven Allen; +Cc: 69019-done

Steven Allen <steven@stebalien.com> writes:

> Philip Kaludercic <philipk@posteo.net> writes:
>> OK, I have slightly modified the commit, can you check if it still works
>> for you:
>
> Tested and confirmed working. And thanks for CCing the list.

OK, I'll push that then under your name and close this bug report.
Thank you for your help!





^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2024-02-13 21:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2024-02-10 18:51 bug#69019: [PATCH] package-vc: scan the correct directory for lisp files Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-11 12:48 ` Philip Kaludercic
2024-02-11 22:46   ` Steven Allen
2024-02-12 17:45     ` Philip Kaludercic
2024-02-12 18:07       ` Steven Allen via Bug reports for GNU Emacs, the Swiss army knife of text editors
2024-02-13 21:07         ` Philip Kaludercic

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).