+2015-02-14 Artur Malabarba <bruce.connor.am@gmail.com>
+
+ * emacs-lisp/package.el (package-read-all-archive-contents): Don't
+ build the compatibility table.
+ (package-refresh-contents, package-initialize): Do build the
+ compatibility table.
+ (package--build-compatibility-table): New function.
+
2015-02-14 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/cl-preloaded.el (cl-struct-define): Register as children
If successful, set `package-archive-contents'."
(setq package-archive-contents nil)
(dolist (archive package-archives)
- (package-read-archive-contents (car archive)))
- ;; Build compat table.
- (setq package--compatibility-table (make-hash-table :test 'eq))
- (package--mapc #'package--add-to-compatibility-table))
+ (package-read-archive-contents (car archive))))
(defun package-read-archive-contents (archive)
"Re-read archive contents for ARCHIVE.
(epg-import-keys-from-file context file)
(message "Importing %s...done" (file-name-nondirectory file))))
+(defun package--build-compatibility-table ()
+ "Build `package--compatibility-table' with `package--mapc'."
+ ;; Build compat table.
+ (setq package--compatibility-table (make-hash-table :test 'eq))
+ (package--mapc #'package--add-to-compatibility-table))
+
;;;###autoload
(defun package-refresh-contents ()
"Download the ELPA archive description if needed.
(package--download-one-archive archive "archive-contents")
(error (message "Failed to download `%s' archive."
(car archive)))))
- (package-read-all-archive-contents))
+ (package-read-all-archive-contents)
+ (package--build-compatibility-table))
(defun package--find-non-dependencies ()
"Return a list of installed packages which are not dependencies.
(unless no-activate
(dolist (elt package-alist)
(package-activate (car elt))))
- (setq package--initialized t))
+ (setq package--initialized t)
+ ;; This uses `package--mapc' so it must be called after
+ ;; `package--initialized' is t.
+ (package--build-compatibility-table))
(defun package--add-to-compatibility-table (pkg)
"If PKG is compatible (without dependencies), add to the compatibility table.