]> git.eshelyaron.com Git - emacs.git/commitdiff
* package-vc.el (package-vc-unpack): Fix 'vc-ignore' call
authorPhilip Kaludercic <philipk@posteo.net>
Tue, 30 Aug 2022 09:28:50 +0000 (11:28 +0200)
committerPhilip Kaludercic <philipk@posteo.net>
Tue, 30 Aug 2022 09:28:54 +0000 (11:28 +0200)
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.

lisp/emacs-lisp/package-vc.el

index ee6a3e79dd84b155d587945387abac75cba88cff..2a45bacf6e965559137d289315ade4d7cd95e22b 100644 (file)
@@ -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))))