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: Sun, 11 Feb 2024 12:48:08 +0000
Message-ID: <87zfw7xj3r.fsf@posteo.net>
References: <87ttmgp2yv.fsf@stebalien.com>
Mime-Version: 1.0
Content-Type: text/plain
Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214";
	logging-data="19618"; 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 Sun Feb 11 13:55:08 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 1rZ9MR-0004pe-Dz
	for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 11 Feb 2024 13:55:07 +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 1rZ9M8-0001DZ-9v; Sun, 11 Feb 2024 07:54:48 -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 1rZ9M6-0001D0-Er
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 07:54: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 1rZ9M5-00021A-VC
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 07:54:46 -0500
Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2)
 (envelope-from <Debian-debbugs@debbugs.gnu.org>) id 1rZ9ML-0005c5-Ph
 for bug-gnu-emacs@gnu.org; Sun, 11 Feb 2024 07:55:01 -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: Sun, 11 Feb 2024 12:55:01 +0000
Resent-Message-ID: <handler.69019.B69019.170765604721449@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.170765604721449
 (code B ref 69019); Sun, 11 Feb 2024 12:55:01 +0000
Original-Received: (at 69019) by debbugs.gnu.org; 11 Feb 2024 12:54:07 +0000
Original-Received: from localhost ([127.0.0.1]:45419 helo=debbugs.gnu.org)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <debbugs-submit-bounces@debbugs.gnu.org>)
 id 1rZ9LS-0005Zq-M1
 for submit@debbugs.gnu.org; Sun, 11 Feb 2024 07:54:07 -0500
Original-Received: from mout01.posteo.de ([185.67.36.65]:55723)
 by debbugs.gnu.org with esmtp (Exim 4.84_2)
 (envelope-from <philipk@posteo.net>) id 1rZ9LQ-0005Z8-IW
 for 69019@debbugs.gnu.org; Sun, 11 Feb 2024 07:54:05 -0500
Original-Received: from submission (posteo.de [185.67.36.169]) 
 by mout01.posteo.de (Postfix) with ESMTPS id 21D61240029
 for <69019@debbugs.gnu.org>; Sun, 11 Feb 2024 13:48:09 +0100 (CET)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.net; s=2017;
 t=1707655689; bh=XwWEU3U3Wcgj1B+aVQye06PlxzmOlhpvIgxIgDBKoaE=;
 h=From:To:Cc:Subject:Autocrypt:Date:Message-ID:MIME-Version:
 Content-Type:From;
 b=j7zj/7vix+Eg63rypSTbH7srdS1FeDe+RQTFpQtEHGqJr+466MnTQr7WUzrgauIAS
 rcZIYGzC17lBWczU5o/YFKeAZuJ1GbM+JMWncqJB4BotW5Aju9JFm2F9BbpPe9gPUC
 ZtxXgqAwRvv1dZvT46wKcuZAspfHkN2O0evqIyKUV5CiCWbBEnFj1TEfr7IbxQi4e4
 F6rKgCRQI+1nkjZQTtpv4TMcagwuFaETalwmN7DQmBC/1MyBJfOOfEwMCTOD4yf8Yc
 tzT/8+SkcDq180H0Atw9IHX7/omEEn6IwSwBuibuHuiuXHvRCxn0Pf+pcm7/xWT6z/
 1hI2T1oPJZ+iA==
Original-Received: from customer (localhost [127.0.0.1])
 by submission (posteo.de) with ESMTPSA id 4TXnSS5CBHz9rxD;
 Sun, 11 Feb 2024 13:48:08 +0100 (CET)
In-Reply-To: <87ttmgp2yv.fsf@stebalien.com> (Steven Allen's message of "Sat,
 10 Feb 2024 10:51:36 -0800")
X-Hashcash: 1:20:240211:69019@debbugs.gnu.org::TlXNW4R35Q/ypBgQ:X9U
X-Hashcash: 1:20:240211:steven@stebalien.com::JNa8nVyWzOdY2PXk:5Sb
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
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:279838
Archived-At: <http://permalink.gmane.org/gmane.emacs.bugs/279838>

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