Commit d6262c7c authored by Bastien Guerry's avatar Bastien Guerry

package.el: various fixes.

* emacs-lisp/package.el (package-installed-p): First check if the
package name is in package-alist.
(package-delete): Correctly delete the package from package-alist.
parent 0a3eec32
2014-01-08 Bastien Guerry <bzg@gnu.org>
* emacs-lisp/package.el (package-installed-p): First check if the
package name is in package-alist.
(package-delete): Correctly delete the package from package-alist.
2014-01-08 Daiki Ueno <ueno@gnu.org>
* emacs-lisp/package.el (url-recreate-url): Declare.
......
......@@ -881,13 +881,14 @@ GnuPG keyring is located under \"gnupg\" in `package-user-dir'."
"Return true if PACKAGE, of MIN-VERSION or newer, is installed.
MIN-VERSION should be a version list."
(unless package--initialized (error "package.el is not yet initialized!"))
(when (assq package package-alist)
(or
(let ((pkg-descs (cdr (assq package package-alist))))
(and pkg-descs
(version-list-<= min-version
(package-desc-version (car pkg-descs)))))
;; Also check built-in packages.
(package-built-in-p package min-version)))
(package-built-in-p package min-version))))
(defun package-compute-transaction (packages requirements)
"Return a list of packages to be installed, including PACKAGES.
......@@ -1232,7 +1233,7 @@ The file can either be a tar file or an Emacs Lisp file."
(delete-file signed-file)))
;; Update package-alist.
(let* ((name (package-desc-name pkg-desc)))
(delete (delete pkg-desc (assq name package-alist)) package-alist))
(setq package-alist (delete (assq name package-alist) package-alist)))
(message "Package `%s' deleted." (package-desc-full-name pkg-desc)))))
(defun package-archive-base (desc)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment