From: Philip Kaludercic Date: Fri, 9 Dec 2022 18:54:25 +0000 (+0100) Subject: Check if package already exists before installing from checkout X-Git-Tag: emacs-29.0.90~1262 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=357fe91996bc6015af002fe4259a3a61a5f32dbb;p=emacs.git Check if package already exists before installing from checkout * lisp/emacs-lisp/package-vc.el (package-vc-install-from-checkout): Copy check from 'package-vc--unpack'. --- diff --git a/lisp/emacs-lisp/package-vc.el b/lisp/emacs-lisp/package-vc.el index 80d268c2958..cf9b98308f1 100644 --- a/lisp/emacs-lisp/package-vc.el +++ b/lisp/emacs-lisp/package-vc.el @@ -754,6 +754,10 @@ 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))) + (when (file-exists-p pkg-dir) + (if (yes-or-no-p (format "Overwrite previous checkout for package `%s'?" name)) + (package--delete-directory pkg-dir) + (error "There already exists a checkout for %s" name))) (make-symbolic-link (expand-file-name dir) pkg-dir) (package-vc--unpack-1 (package-desc-create