summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorPhilip Kaludercic <philipk@posteo.net>2023-02-14 19:49:51 +0100
committerPhilip Kaludercic <philipk@posteo.net>2023-02-14 19:50:01 +0100
commita3751b5d0c1a6aa4edaa16504012fb4a0e6302f9 (patch)
treeb303ce96a5a6c5a9aaa586aeef256602b1de0290 /lisp/emacs-lisp
parent6a32ba8b69c9d7a9c356611bb8033a0a83b4e8b8 (diff)
downloademacs-a3751b5d0c1a6aa4edaa16504012fb4a0e6302f9.tar.gz
emacs-a3751b5d0c1a6aa4edaa16504012fb4a0e6302f9.tar.bz2
emacs-a3751b5d0c1a6aa4edaa16504012fb4a0e6302f9.zip
; Raise an error if a VC package checkout is empty
* lisp/emacs-lisp/package-vc.el (package-vc--unpack): Check if PKG-DIR is empty before proceeding with the installation.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package-vc.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index 4a987052949..bad59aa6c0f 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -611,7 +611,7 @@ checkout. This overrides the `:branch' attribute in PKG-SPEC."
(pcase-let* (((map :lisp-dir) pkg-spec)
(name (package-desc-name pkg-desc))
(dirname (package-desc-full-name pkg-desc))
- (pkg-dir (expand-file-name dirname package-user-dir)))
+ (pkg-dir (file-name-as-directory (expand-file-name dirname package-user-dir))))
(when (string-empty-p name)
(user-error "Empty package name"))
(setf (package-desc-dir pkg-desc) pkg-dir)
@@ -620,6 +620,9 @@ checkout. This overrides the `:branch' attribute in PKG-SPEC."
(package--delete-directory pkg-dir)
(error "There already exists a checkout for %s" name)))
(package-vc--clone pkg-desc pkg-spec pkg-dir rev)
+ (when (directory-empty-p pkg-dir)
+ (delete-directory pkg-dir)
+ (error "Empty checkout for %s" name))
;; When nothing is specified about a `lisp-dir', then should
;; heuristically check if there is a sub-directory with lisp