GNU bug report logs - #19864
25.0.50; package-initialize is no more starting

Previous Next

Package: emacs;

Reported by: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>

Date: Sat, 14 Feb 2015 07:18:02 UTC

Severity: normal

Found in version 25.0.50

Done: Bastien <bzg <at> altern.org>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: Thierry Volpiatto <thierry.volpiatto <at> gmail.com>
To: 19864 <at> debbugs.gnu.org
Subject: bug#19864: 25.0.50; package-initialize is no more starting
Date: Sat, 14 Feb 2015 09:12:26 +0100
Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:

> Bastien <bzg <at> altern.org> writes:
>
>> Hi Thierry,
>>
>> Thierry Volpiatto <thierry.volpiatto <at> gmail.com> writes:
>>
>>> Actually to start emacs-25 I have to advice `package-initialize' to set
>>> `package--initialized' before.
>>
>> Yes, I reported this here:
>> http://article.gmane.org/gmane.emacs.diffs/129142
>>
>> See the attached patch.
>>
>> Can you double check it's correct for you?
>> CC'ing Artur as he may want to double check too.
>
> Looks more like a work around, (i.e what's package--initialized utility
> if we have to let-bound it to be able to run code) Arthur will decide
> what to do.

Here a patch that set package--initialized when package-archive-contents
is feeded and then setup package--compatibility-table.

diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index d8b4595..f7b9ef9 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1139,13 +1139,17 @@ Will throw an error if the archive version is too new."
                      (car contents) package-archive-version))
           (cdr contents))))))
 
-(defun package-read-all-archive-contents ()
+(defun package-read-all-archive-contents (&optional no-compat-table)
   "Re-read `archive-contents', if it exists.
 If successful, set `package-archive-contents'."
   (setq package-archive-contents nil)
   (dolist (archive package-archives)
     (package-read-archive-contents (car archive)))
   ;; Build compat table.
+  (unless no-compat-table
+    (package--build-compat-table)))
+
+(defun package--build-compat-table ()
   (setq package--compatibility-table (make-hash-table :test 'eq))
   (package--mapc #'package--add-to-compatibility-table))
 
@@ -1738,11 +1742,14 @@ If optional arg NO-ACTIVATE is non-nil, don't activate packages."
   (interactive)
   (setq package-alist nil)
   (package-load-all-descriptors)
-  (package-read-all-archive-contents)
+  (package-read-all-archive-contents t)
+  ;; Decide package is initialized when
+  ;; `package-archive-contents' is feeded.
+  (setq package--initialized t)
+  (package--build-compat-table)
   (unless no-activate
     (dolist (elt package-alist)
-      (package-activate (car elt))))
-  (setq package--initialized t))
+      (package-activate (car elt)))))
 
 (defun package--add-to-compatibility-table (pkg)
   "If PKG is compatible (without dependencies), add to the compatibility table.

-- 
Thierry
Get my Gnupg key:
gpg --keyserver pgp.mit.edu --recv-keys 59F29997 





This bug report was last modified 10 years and 100 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.