summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package-vc.el8
1 files changed, 7 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el
index ddcfe57928b..b5b8a6746a6 100644
--- a/lisp/emacs-lisp/package-vc.el
+++ b/lisp/emacs-lisp/package-vc.el
@@ -600,10 +600,14 @@ PKG-SPEC is a package specification, a property list describing
how to fetch and build the package. See `package-vc--archive-spec-alist'
for details. The optional argument REV specifies a specific revision to
checkout. This overrides the `:branch' attribute in PKG-SPEC."
+ (unless pkg-desc
+ (package-desc-create :name (car pkg-spec) :kind 'vc))
(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)))
+ (when (string-empty-p name)
+ (user-error "Empty package name"))
(setf (package-desc-dir pkg-desc) pkg-dir)
(when (file-exists-p pkg-dir)
(if (yes-or-no-p (format "Overwrite previous checkout for package `%s'?" name))
@@ -771,7 +775,9 @@ regular package, but it will not remove a VC package.
(package-vc--archives-initialize)
(let* ((name-or-url (package-vc--read-package-name
"Fetch and install package: " t))
- (name (file-name-base name-or-url)))
+ (name (file-name-base (directory-file-name name-or-url))))
+ (when (string-empty-p name)
+ (user-error "Empty package name"))
(list name-or-url
(and current-prefix-arg :last-release)
nil