diff options
author | Stefan Kangas <stefankangas@gmail.com> | 2019-10-20 23:49:18 +0200 |
---|---|---|
committer | Stefan Kangas <stefankangas@gmail.com> | 2019-10-21 00:00:36 +0200 |
commit | 0e6f4628d8fff53505e4399e71da9f531a64fff7 (patch) | |
tree | 22b587b6b12cba555590d22f586b94d5eccd30c1 /lisp/emacs-lisp/package.el | |
parent | 78cb3791fa11c95756ee3917c63cfea774f128a2 (diff) | |
download | emacs-0e6f4628d8fff53505e4399e71da9f531a64fff7.tar.gz |
Don't try to add nil packages on refresh
* lisp/emacs-lisp/package.el (package-read-archive-contents): Don't
try to add nil entries. Warn instead. (Bug#28502)
* test/lisp/emacs-lisp/package-tests.el
(package-test-update-archives/ignore-nil-entry): New test.
* test/lisp/emacs-lisp/package-resources/with-nil-entry/archive-contents:
New file.
Diffstat (limited to 'lisp/emacs-lisp/package.el')
-rw-r--r-- | lisp/emacs-lisp/package.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 20462064afd..645e831bcc9 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1520,7 +1520,10 @@ If the archive version is too new, signal an error." (contents (package--read-archive-file contents-file))) (when contents (dolist (package contents) - (package--add-to-archive-contents package archive))))) + (if package + (package--add-to-archive-contents package archive) + (lwarn '(package refresh) :warning + "Ignoring `nil' package on `%s' package archive" archive)))))) (defvar package--old-archive-priorities nil "Store currently used `package-archive-priorities'. |