(vc-retrieve-tag dir release-rev)
(message "No release revision was found, continuing...")))))
+(defvar package-vc-non-code-file-names
+ '(".dir-locals.el" ".dir-locals-2.el")
+ "List of file names that do not contain Emacs Lisp code.
+This list is used by `package-vc--unpack' to better check if the
+user is fetching code from a repository that does not contain any
+Emacs Lisp files.")
+
(defun package-vc--unpack (pkg-desc pkg-spec &optional rev)
"Install the package described by PKG-DESC.
PKG-SPEC is a package specification, a property list describing
(when (directory-empty-p pkg-dir)
(delete-directory pkg-dir)
(error "Empty checkout for %s" name))
+ (unless (seq-remove
+ (lambda (file)
+ (member (file-name-nondirectory file) package-vc-non-code-file-names))
+ (directory-files-recursively pkg-dir "\\.el\\'" nil))
+ (when (yes-or-no-p (format "No Emacs Lisp files found when fetching \"%s\", \
+abort installation?" name))
+ (delete-directory pkg-dir t)
+ (user-error "Installation aborted")))
;; When nothing is specified about a `lisp-dir', then should
;; heuristically check if there is a sub-directory with lisp