From: Philip Kaludercic Date: Tue, 30 Aug 2022 09:28:50 +0000 (+0200) Subject: * package-vc.el (package-vc-unpack): Fix 'vc-ignore' call X-Git-Tag: emacs-29.0.90~1616^2~307^2~84 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d5dbf0804c5a3025f7946991a39ec26c01f76212;p=emacs.git * package-vc.el (package-vc-unpack): Fix 'vc-ignore' call When generating the manual node (/dir), we need to ensure that the default-directory is set to the package root, otherwise the file is ignored in some other repository, that probably doesn't exist. --- diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index ee6a3e79dd8..2a45bacf6e9 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -169,7 +169,7 @@ The output is written out into PKG-FILE." (package-download-transaction (package-compute-transaction nil (delete-dups deps))))) - (let ((default-directory pkg-dir) + (let ((default-directory (file-name-as-directory pkg-dir)) (name (package-desc-name pkg-desc)) (pkg-file (expand-file-name (package--description-file pkg-dir) pkg-dir))) ;; Generate autoloads @@ -180,7 +180,18 @@ The output is written out into PKG-FILE." ;; Generate package file (package-vc-generate-description-file pkg-desc pkg-file) - (vc-ignore (concat "/" (file-relative-name pkg-file default-directory)))) + (vc-ignore (concat "/" (file-relative-name pkg-file default-directory))) + + ;; Detect a manual + (when (executable-find "install-info") + ;; Only proceed if we can find an unambiguous TeXinfo file + (let ((texi-files (directory-files pkg-dir t "\\.texi\\'")) + (dir-file (expand-file-name "dir" pkg-dir))) + (when (length= texi-files 1) + (call-process "install-info" nil nil nil + (concat "--dir=" dir-file) + (car texi-files))) + (vc-ignore "/dir")))) ;; Update package-alist. (let ((new-desc (package-load-descriptor pkg-dir))) @@ -198,17 +209,6 @@ The output is written out into PKG-FILE." ;; `activate-1', so that we use the byte-compiled definitions. (package--reload-previously-loaded new-desc))) - ;; Detect a manual - (when (executable-find "install-info") - ;; Only proceed if we can find an unambiguous TeXinfo file - (let ((texi-files (directory-files pkg-dir t "\\.texi\\'")) - (dir-file (expand-file-name "dir" pkg-dir))) - (when (length= texi-files 1) - (call-process "install-info" nil nil nil - (concat "--dir=" dir-file) - (car texi-files))) - (vc-ignore "/dir"))) - ;; Mark package as selected (package--save-selected-packages (cons name package-selected-packages))))