Commit 8d3b9102 authored by Artur Malabarba's avatar Artur Malabarba
Browse files

* lisp/emacs-lisp/package.el (package-compute-transaction):

Don't assume version sorting.
parent d0a5162f
...@@ -1576,29 +1576,33 @@ SEEN is used internally to detect infinite recursion." ...@@ -1576,29 +1576,33 @@ SEEN is used internally to detect infinite recursion."
(while (and pkg-descs (not found)) (while (and pkg-descs (not found))
(let* ((pkg-desc (pop pkg-descs)) (let* ((pkg-desc (pop pkg-descs))
(version (package-desc-version pkg-desc)) (version (package-desc-version pkg-desc))
(disabled (package-disabled-p next-pkg version))) (disabled (package-disabled-p next-pkg version))
(cond (cond
((version-list-< version next-version) ((version-list-< version next-version)
(error ;; pkg-descs is sorted by priority, not version, so
"Need package `%s-%s', but only %s is available" ;; don't error just yet.
next-pkg (package-version-join next-version) (unless found-something
(package-version-join version))) (setq found-something (package-version-join version))))
(disabled (disabled
(unless problem (unless problem
(setq problem (setq problem
(if (stringp disabled) (if (stringp disabled)
(format "Package `%s' held at version %s, \ (format "Package `%s' held at version %s, but version %s required"
but version %s required"
next-pkg disabled next-pkg disabled
(package-version-join next-version)) (package-version-join next-version))
(format "Required package '%s' is disabled" (format "Required package '%s' is disabled"
next-pkg))))) next-pkg)))))
(t (setq found pkg-desc))))) (t (setq found pkg-desc)))))
(unless found (unless found
(if problem (cond
(error "%s" problem) (problem (error "%s" problem))
(error "Package `%s-%s' is unavailable" (found-something
next-pkg (package-version-join next-version)))) (error "Need package `%s-%s', but only %s is available"
next-pkg (package-version-join next-version)
(t (error "Package `%s-%s' is unavailable"
next-pkg (package-version-join next-version)))))
(setq packages (setq packages
(package-compute-transaction (cons found packages) (package-compute-transaction (cons found packages)
(package-desc-reqs found) (package-desc-reqs found)
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