From: Philip Kaludercic Date: Wed, 16 Nov 2022 09:28:14 +0000 (+0100) Subject: Fix issues related to 'package-vc-install-from-checkout' X-Git-Tag: emacs-29.0.90~1616^2~61 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5b8f165f75698f3d0dd612129f4e6405430567e7;p=emacs.git Fix issues related to 'package-vc-install-from-checkout' * lisp/emacs-lisp/package-vc.el (package-vc--main-file): Ensure the package name is a string. (package-vc--unpack-1): Use pkg-dir instead of the empty return value of 'package-lisp-dir'. (package-vc-install-from-checkout): Fix file name handling. --- diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index aa674586764..8811f9ac7b7 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -296,15 +296,14 @@ asynchronously." (defun package-vc--main-file (pkg-desc) "Return the name of the main file for PKG-DESC." (cl-assert (package-vc-p pkg-desc)) - (let ((pkg-spec (package-vc--desc->spec pkg-desc))) + (let ((pkg-spec (package-vc--desc->spec pkg-desc)) + (name (symbol-name (package-desc-name pkg-desc)))) (or (plist-get pkg-spec :main-file) (expand-file-name - (format "%s.el" (package-desc-name pkg-desc)) + (concat name ".el") (file-name-concat (or (package-desc-dir pkg-desc) - (expand-file-name - (package-desc-name pkg-desc) - package-user-dir)) + (expand-file-name name package-user-dir)) (plist-get pkg-spec :lisp-dir)))))) (defun package-vc--generate-description-file (pkg-desc pkg-file) @@ -396,8 +395,8 @@ documentation and marking the package as installed." ;; In case the package was installed directly from source, the ;; dependency list wasn't know beforehand, and they might have ;; to be installed explicitly. - (let (deps) - (dolist (file (directory-files (package-lisp-dir pkg-desc) t "\\.el\\'" t)) + (let ((deps '())) + (dolist (file (directory-files pkg-dir t "\\.el\\'" t)) (with-temp-buffer (insert-file-contents file) (when-let* ((require-lines (lm-header-multiline "package-requires"))) @@ -748,11 +747,12 @@ name from the base name of DIR." (package-vc--archives-initialize) (let* ((name (or name (file-name-base (directory-file-name dir)))) (pkg-dir (expand-file-name name package-user-dir))) - (make-symbolic-link dir pkg-dir) - (package-vc--unpack-1 (package-desc-create - :name (intern name) - :kind 'vc) - pkg-dir))) + (make-symbolic-link (expand-file-name dir) pkg-dir) + (package-vc--unpack-1 + (package-desc-create + :name (intern name) + :kind 'vc) + (file-name-as-directory pkg-dir)))) ;;;###autoload (defun package-vc-rebuild (pkg-desc)