summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp
diff options
context:
space:
mode:
authorArtur Malabarba <bruce.connor.am@gmail.com>2015-06-30 10:47:25 +0100
committerArtur Malabarba <bruce.connor.am@gmail.com>2015-06-30 10:47:25 +0100
commit8d3b9102130dd7091803d96c94415b24fe8a5bbf (patch)
tree9ec219459bca2dd47bff11657bd43b14077249d7 /lisp/emacs-lisp
parentd0a5162fd825acbbd863e61099e1fa1ce5975773 (diff)
downloademacs-8d3b9102130dd7091803d96c94415b24fe8a5bbf.tar.gz
emacs-8d3b9102130dd7091803d96c94415b24fe8a5bbf.tar.bz2
emacs-8d3b9102130dd7091803d96c94415b24fe8a5bbf.zip
* lisp/emacs-lisp/package.el (package-compute-transaction):
Don't assume version sorting.
Diffstat (limited to 'lisp/emacs-lisp')
-rw-r--r--lisp/emacs-lisp/package.el26
1 files changed, 15 insertions, 11 deletions
diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
index e599e840fb7..a148783d0c2 100644
--- a/lisp/emacs-lisp/package.el
+++ b/lisp/emacs-lisp/package.el
@@ -1576,29 +1576,33 @@ SEEN is used internally to detect infinite recursion."
(while (and pkg-descs (not found))
(let* ((pkg-desc (pop pkg-descs))
(version (package-desc-version pkg-desc))
- (disabled (package-disabled-p next-pkg version)))
+ (disabled (package-disabled-p next-pkg version))
+ found-something)
(cond
((version-list-< version next-version)
- (error
- "Need package `%s-%s', but only %s is available"
- next-pkg (package-version-join next-version)
- (package-version-join version)))
+ ;; pkg-descs is sorted by priority, not version, so
+ ;; don't error just yet.
+ (unless found-something
+ (setq found-something (package-version-join version))))
(disabled
(unless problem
(setq problem
(if (stringp disabled)
- (format "Package `%s' held at version %s, \
-but version %s required"
+ (format "Package `%s' held at version %s, but version %s required"
next-pkg disabled
(package-version-join next-version))
(format "Required package '%s' is disabled"
next-pkg)))))
(t (setq found pkg-desc)))))
(unless found
- (if problem
- (error "%s" problem)
- (error "Package `%s-%s' is unavailable"
- next-pkg (package-version-join next-version))))
+ (cond
+ (problem (error "%s" problem))
+ (found-something
+ (error "Need package `%s-%s', but only %s is available"
+ next-pkg (package-version-join next-version)
+ found-something))
+ (t (error "Package `%s-%s' is unavailable"
+ next-pkg (package-version-join next-version)))))
(setq packages
(package-compute-transaction (cons found packages)
(package-desc-reqs found)