unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Thierry Volpiatto <thierry.volpiatto@gmail.com>
To: 19864@debbugs.gnu.org
Subject: bug#19864: 25.0.50; package-initialize is no more starting
Date: Sat, 14 Feb 2015 09:12:26 +0100	[thread overview]
Message-ID: <87mw4gnc7p.fsf@gmail.com> (raw)
In-Reply-To: <87h9uphshx.fsf@gmail.com>

Thierry Volpiatto <thierry.volpiatto@gmail.com> writes:

> Bastien <bzg@altern.org> writes:
>
>> Hi Thierry,
>>
>> Thierry Volpiatto <thierry.volpiatto@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 






  reply	other threads:[~2015-02-14  8:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-14  7:17 bug#19864: 25.0.50; package-initialize is no more starting Thierry Volpiatto
2015-02-14  7:21 ` Bastien
2015-02-14  7:37   ` Thierry Volpiatto
2015-02-14  8:12     ` Thierry Volpiatto [this message]
2015-02-15  9:48       ` Thierry Volpiatto
2015-02-15 14:45         ` Artur Malabarba
2015-02-16  7:04           ` Thierry Volpiatto
2015-02-16  8:20             ` Bastien

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87mw4gnc7p.fsf@gmail.com \
    --to=thierry.volpiatto@gmail.com \
    --cc=19864@debbugs.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).