changeset 111316:c133fe92297f

Two fixes for elpa packages overriding built-in ones. * emacs-lisp/package.el (package-initialize): Ensure that obsoleted built-in packages are not in package-activated-list during activation. (describe-package-1): Make the "installed" status override "built-in".
author Chong Yidong <cyd@stupidchicken.com>
date Mon, 01 Nov 2010 21:50:26 -0400
parents bad40b05a0df
children bdfd83386e2d
files lisp/ChangeLog lisp/emacs-lisp/package.el
diffstat 2 files changed, 19 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Mon Nov 01 23:50:22 2010 -0200
+++ b/lisp/ChangeLog	Mon Nov 01 21:50:26 2010 -0400
@@ -1,3 +1,11 @@
+2010-11-02  Chong Yidong  <cyd@stupidchicken.com>
+
+	* emacs-lisp/package.el (package-initialize): Ensure that
+	obsoleted built-in packages are not in package-activated-list
+	during activation.
+	(describe-package-1): Make the "installed" status override
+	"built-in".
+
 2010-11-01  Vinicius Jose Latorre  <viniciusjl@ig.com.br>
 
 	* subr.el (version-separator, version-regexp-alist): Remove '*'
--- a/lisp/emacs-lisp/package.el	Mon Nov 01 23:50:22 2010 -0200
+++ b/lisp/emacs-lisp/package.el	Mon Nov 01 21:50:26 2010 -0400
@@ -1020,15 +1020,17 @@
 The variable `package-load-list' controls which packages to load."
   (interactive)
   (require 'finder-inf nil t)
-  (setq package-alist package--builtins)
-  (setq package-activated-list (mapcar #'car package-alist))
-  (setq package-obsolete-alist nil)
+  (setq package-alist package--builtins
+	package-activated-list (mapcar #'car package-alist)
+	package-obsolete-alist nil)
   (package-load-all-descriptors)
   (package-read-all-archive-contents)
+  ;; "Deactivate" obsoleted built-in packages
+  (dolist (elt package-obsolete-alist)
+    (delq (car elt) package-activated-list))
   ;; Try to activate all our packages.
-  (mapc (lambda (elt)
-	  (package-activate (car elt) (package-desc-vers (cdr elt))))
-	package-alist))
+  (dolist (elt package-alist)
+    (package-activate (car elt) (package-desc-vers (cdr elt)))))
 
 
 ;;;; Package description buffer.
@@ -1073,10 +1075,10 @@
 	;; This package is loaded (i.e. in `package-alist').
 	(progn
 	  (setq version (package-version-join (package-desc-vers desc)))
-	  (cond (built-in
+	  (cond ((setq pkg-dir (package--dir package-name version))
+		 (insert "an installed package.\n\n"))
+		(built-in
 		 (princ "a built-in package.\n\n"))
-		((setq pkg-dir (package--dir package-name version))
-		 (insert "an installed package.\n\n"))
 		(t ;; This normally does not happen.
 		 (insert "a deleted package.\n\n")
 		 (setq version nil))))