From mboxrd@z Thu Jan  1 00:00:00 1970
Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail
From: Philip Kaludercic <philipk@posteo.net>
Newsgroups: gmane.emacs.bugs
Subject: bug#69019: [PATCH] package-vc: scan the correct directory for lisp
 files
Date: Mon, 12 Feb 2024 17:45:59 +0000
Message-ID: <8734tx37ag.fsf@posteo.net>
References: <87ttmgp2yv.fsf@stebalien.com> <87zfw7xj3r.fsf@posteo.net>
 <875xyu39gk.fsf@stebalien.com>
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="3482"; mail-complaints-to="usenet@ciao.gmane.io"
Cc: 69019@debbugs.gnu.org
To: Steven Allen <steven@stebalien.com>
Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Feb 12 18:47:11 2024
Return-path: <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>
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 <bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org>)
	id 1rZaOc-0000hd-5Q
	for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 12 Feb 2024 18:47:10 +0100
Original-Received: from localhost ([::1] helo=lists1p.gnu.org)
	by lists.gnu.org with esmtp (Exim 4.90_1)
	(envelope-from <bug-gnu-emacs-bounces@gnu.org>)
	id 1rZaOF-0007UD-R7; Mon, 12 Feb 2024 12:46:47 -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 <Debian-debbugs@debbugs.gnu.org>)
 id 1rZaOD-0007U0-Vf
 for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 12:46:46 -0500
Original-Received: from debbugs.gnu.org ([2001:470:142:5::43])
 by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128)
 (Exim 4.90_1) (envelope-from <Debian-debbugs@debbugs.gnu.org>)
 id 1rZaOD-0003B0-N3
 for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 12:46:45 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rZaOU-00059Y-51
 for bug-gnu-emacs@gnu.org; Mon, 12 Feb 2024 12:47:02 -0500
X-Loop: help-debbugs@gnu.org
Resent-From: Philip Kaludercic <philipk@posteo.net>
Original-Sender: "Debbugs-submit" <debbugs-submit-bounces@debbugs.gnu.org>
Resent-CC: bug-gnu-emacs@gnu.org
Resent-Date: Mon, 12 Feb 2024 17:47:02 +0000
Resent-Message-ID: <handler.69019.B69019.170775999119689@debbugs.gnu.org>
Resent-Sender: help-debbugs@gnu.org
X-GNU-PR-Message: followup 69019
X-GNU-PR-Package: emacs
X-GNU-PR-Keywords: patch
Original-Received: via spool by 69019-submit@debbugs.gnu.org id=B69019.170775999119689
 (code B ref 69019); Mon, 12 Feb 2024 17:47:02 +0000
Original-Received: (at 69019) by debbugs.gnu.org; 12 Feb 2024 17:46:31 +0000
Original-Received: from localhost ([127.0.0.1]:45300 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rZaNw-00057L-D8
 for submit@debbugs.gnu.org; Mon, 12 Feb 2024 12:46:31 -0500
Original-Received: from mout02.posteo.de ([185.67.36.66]:55533)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@posteo.net>) id 1rZaNr-00056E-J7
 for 69019@debbugs.gnu.org; Mon, 12 Feb 2024 12:46:27 -0500
Original-Received: from submission (posteo.de [185.67.36.169]) 
 by mout02.posteo.de (Postfix) with ESMTPS id 9A86D240103
 for <69019@debbugs.gnu.org>; Mon, 12 Feb 2024 18:46:00 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1707759960; bh=kQ1IYF2Ily9gRI7B6+FRpdSSSeL05rFPauCG7VBKd30=;
 h=From:To:Cc:Subject:Autocrypt:OpenPGP:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=D+Fsp8Tp1pR+lN18qXWyMIa7EsLg052Cl6peRXrMA/ACqVnklWN9uctj2p/fbjVAA
 1qy3s3Z2RrL9uxB3oUrsPTqrWsGVCWQOB0TuodcZm6mQqzuyVeMdyde1sFsvg6DcWr
 A6p8ygD4td+E7MIm4HNdQeyZ1jjvbAgA2do33TwneDuPsNFLLz4FiCCaz1vikAou3g
 HC93DcpTfncgQQtSF795PfYkj+ekuEvgtMJYyVq1nieDOSzmhVWhIriNJlUFsz/Z3K
 UAjpnHPbVuR5iOBpbIYByak4ObmCzOt8n5v4o/WCcjNMUasBLKhOwV1kSG9U875csN
 lqVs0D7ElgERg==
Original-Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TYX1h12JGz6txL;
 Mon, 12 Feb 2024 18:45:59 +0100 (CET)
In-Reply-To: <875xyu39gk.fsf@stebalien.com> (Steven Allen's message of "Sun,
 11 Feb 2024 14:46:51 -0800")
Autocrypt: addr=philipk@posteo.net; keydata=
 mDMEZBBQQhYJKwYBBAHaRw8BAQdAHJuofBrfqFh12uQu0Yi7mrl525F28eTmwUDflFNmdui0QlBo
 aWxpcCBLYWx1ZGVyY2ljIChnZW5lcmF0ZWQgYnkgYXV0b2NyeXB0LmVsKSA8cGhpbGlwa0Bwb3N0
 ZW8ubmV0PoiWBBMWCAA+FiEEDg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwMFCQHhM4AFCwkI
 BwIGFQoJCAsCBBYCAwECHgECF4AACgkQ8xYDWXahwulikAEA77hloUiSrXgFkUVJhlKBpLCHUjA0
 mWZ9j9w5d08+jVwBAK6c4iGP7j+/PhbkxaEKa4V3MzIl7zJkcNNjHCXmvFcEuDgEZBBQQhIKKwYB
 BAGXVQEFAQEHQI5NLiLRjZy3OfSt1dhCmFyn+fN/QKELUYQetiaoe+MMAwEIB4h+BBgWCAAmFiEE
 Dg7HY17ghYlni8XN8xYDWXahwukFAmQQUEICGwwFCQHhM4AACgkQ8xYDWXahwukm+wEA8cml4JpK
 NeAu65rg+auKrPOP6TP/4YWRCTIvuYDm0joBALw98AMz7/qMHvSCeU/hw9PL6u6R2EScxtpKnWof
 z4oM
OpenPGP: id=7126E1DE2F0CE35C770BED01F2C3CC513DB89F66;
 url="https://keys.openpgp.org/vks/v1/by-fingerprint/7126E1DE2F0CE35C770BED01F2C3CC513DB89F66";
 preference=signencrypt
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" <bug-gnu-emacs.gnu.org>
List-Unsubscribe: <https://lists.gnu.org/mailman/options/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=unsubscribe>
List-Archive: <https://lists.gnu.org/archive/html/bug-gnu-emacs>
List-Post: <mailto:bug-gnu-emacs@gnu.org>
List-Help: <mailto:bug-gnu-emacs-request@gnu.org?subject=help>
List-Subscribe: <https://lists.gnu.org/mailman/listinfo/bug-gnu-emacs>,
 <mailto:bug-gnu-emacs-request@gnu.org?subject=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:279907
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/279907>

--=-=-=
Content-Type: text/plain

(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:


--=-=-=
Content-Type: text/x-patch
Content-Disposition: attachment;
 filename=0001-Respect-lisp-dir-whilst-scanning-for-VC-package-depe.patch

>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


--=-=-=
Content-Type: text/plain


>>> * 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!

--=-=-=--