From: Chong Yidong Date: Tue, 2 Nov 2010 01:50:26 +0000 (-0400) Subject: Two fixes for elpa packages overriding built-in ones. X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~45^2~414 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=0f75c62ae368984e9379a13233dd9c443ea57bdd;p=emacs.git 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". --- diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 120b37a6f25..239f50c3c80 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog @@ -1,3 +1,11 @@ +2010-11-02 Chong Yidong + + * 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 * subr.el (version-separator, version-regexp-alist): Remove '*' diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el index 454036018be..f6e7b893cd6 100644 --- a/lisp/emacs-lisp/package.el +++ b/lisp/emacs-lisp/package.el @@ -1020,15 +1020,17 @@ makes them available for download." 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 @@ The variable `package-load-list' controls which packages to load." ;; This package is loaded (i.e. in `package-alist'). (progn (setq version (package-version-join (package-desc-vers desc))) - (cond (built-in - (princ "a built-in package.\n\n")) - ((setq pkg-dir (package--dir package-name version)) + (cond ((setq pkg-dir (package--dir package-name version)) (insert "an installed package.\n\n")) + (built-in + (princ "a built-in package.\n\n")) (t ;; This normally does not happen. (insert "a deleted package.\n\n") (setq version nil))))