From: Philip Kaludercic Date: Wed, 15 Mar 2023 09:05:39 +0000 (+0100) Subject: Do not store :lisp-dir in package descriptors X-Git-Tag: emacs-29.0.90~177 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=39fea1155150b48344cd9971c6248bc7b7a369f9;p=emacs.git Do not store :lisp-dir in package descriptors * lisp/emacs-lisp/package-vc.el (package-vc--main-file) (package-vc--unpack-1): Query 'pkg-spec' instead of 'package-desc-extras'. (package-vc--unpack): Do not update 'package-desc-extras'. This simplification is possible due to the change in 2718bbb3bc, since we now ensure that package specifications are not lost. They are either provided by a package archive or stored in 'package-vc-selected-packages'. --- diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 652f2518672..09f8b4462e2 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -305,12 +305,11 @@ asynchronously." (directory (file-name-concat (or (package-desc-dir pkg-desc) (expand-file-name name package-user-dir)) - (and-let* ((extras (package-desc-extras pkg-desc))) - (alist-get :lisp-dir extras)))) - (file (or (plist-get pkg-spec :main-file) - (expand-file-name - (concat name ".el") - directory)))) + (plist-get pkg-spec :lisp-dir))) + (file (expand-file-name + (or (plist-get pkg-spec :main-file) + (concat name ".el")) + directory))) (if (file-exists-p file) file ;; The following heuristic is only necessary when fetching a ;; repository with URL that would break the above assumptions. @@ -491,12 +490,12 @@ documentation and marking the package as installed." missing))) (let ((default-directory (file-name-as-directory pkg-dir)) - (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir))) + (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir)) + (pkg-spec (package-vc--desc->spec pkg-desc))) ;; Generate autoloads (let* ((name (package-desc-name pkg-desc)) (auto-name (format "%s-autoloads.el" name)) - (extras (package-desc-extras pkg-desc)) - (lisp-dir (alist-get :lisp-dir extras))) + (lisp-dir (plist-get pkg-spec :lisp-dir))) (package-generate-autoloads name (file-name-concat pkg-dir lisp-dir)) (when lisp-dir @@ -516,8 +515,7 @@ documentation and marking the package as installed." (package-vc--generate-description-file pkg-desc pkg-file) ;; Detect a manual - (when-let ((pkg-spec (package-vc--desc->spec pkg-desc)) - ((executable-find "install-info"))) + (when (executable-find "install-info") (dolist (doc-file (ensure-list (plist-get pkg-spec :doc))) (package-vc--build-documentation pkg-desc doc-file)))) @@ -655,11 +653,6 @@ abort installation?" name)) ;; file system or between installations. (throw 'done (setq lisp-dir name))))) - ;; Store the :lisp-dir - (when lisp-dir - (push (cons :lisp-dir lisp-dir) - (package-desc-extras pkg-desc))) - ;; Ensure we have a copy of the package specification (unless (equal (alist-get name (mapcar #'cdr package-vc--archive-spec-alist)) pkg-spec) (customize-save-variable