]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug#16826
authorDmitry Gutov <dgutov@yandex.ru>
Fri, 21 Mar 2014 06:06:52 +0000 (08:06 +0200)
committerDmitry Gutov <dgutov@yandex.ru>
Fri, 21 Mar 2014 06:06:52 +0000 (08:06 +0200)
* lisp/emacs-lisp/package.el (package-compute-transaction):
Use `version-list-<=' to compare the requirement version against
the package version already to be installed.  Update the error
message.

lisp/ChangeLog
lisp/emacs-lisp/package.el
test/automated/data/package/archive-contents
test/automated/data/package/simple-two-depend-1.1.el [new file with mode: 0644]
test/automated/package-test.el

index d77e4e4b4bec9d370308f90ca789398e4f85f422..07af775379cb61c21e3b00661e73128c290f51ac 100644 (file)
@@ -1,5 +1,10 @@
 2014-03-21  Dmitry Gutov  <dgutov@yandex.ru>
 
+       * emacs-lisp/package.el (package-compute-transaction):
+       Use `version-list-<=' to compare the requirement version against
+       the version of package already to be installed.  Update the error
+       message.  (Bug#16826)
+
        * progmodes/ruby-mode.el (ruby-smie-rules):
        Add indentation rule for ` @ '.  (Bug#17050)
 
index e0d1c99d369932fbfd2698f24f86f5997470b750..ae2c286288768001ec760ab084b076d512a95a2b 100644 (file)
@@ -923,10 +923,10 @@ not included in this list."
             (setq already pkg)))
       (cond
        (already
-        (if (version-list-< next-version (package-desc-version already))
+        (if (version-list-<= next-version (package-desc-version already))
             ;; Move to front, so it gets installed early enough (bug#14082).
             (setq packages (cons already (delq already packages)))
-          (error "Need package `%s-%s', but only %s is available"
+          (error "Need package `%s-%s', but only %s is being installed"
                  next-pkg (package-version-join next-version)
                  (package-version-join (package-desc-version already)))))
 
index 8d6f3226ae6266ff797fbdfdf6ec9f723bbf46a1..a6df6b8086ea67f4bcdd7b3b6403b2b165f15a72 100644 (file)
@@ -6,6 +6,10 @@
  (simple-depend .
                 [(1 0)
                  ((simple-single (1 3))) "A single-file package with a dependency." single])
+ (simple-two-depend .
+                [(1 1)
+                 ((simple-depend (1 0)) (simple-single (1 3)))
+                 "A single-file package with two dependencies." single])
  (multi-file .
              [(0 2 3)
               nil "Example of a multi-file tar package" tar
diff --git a/test/automated/data/package/simple-two-depend-1.1.el b/test/automated/data/package/simple-two-depend-1.1.el
new file mode 100644 (file)
index 0000000..9cfe5c0
--- /dev/null
@@ -0,0 +1,17 @@
+;;; simple-two-depend.el --- A single-file package with two dependencies.
+
+;; Author: J. R. Hacker <jrh@example.com>
+;; Version: 1.1
+;; Keywords: frobnicate
+;; Package-Requires: ((simple-depend "1.0") (simple-single "1.3"))
+
+;;; Commentary:
+
+;; Depends on two another packages.
+
+;;; Code:
+
+(defvar simple-two-depend "Value"
+  "Some trivial code")
+
+;;; simple-two-depend.el ends here
index 34a3ce25a483ebabfc47635111154d78261e7219..72422a8684bfe7814f6cc5eb1aed64d2fba9120b 100644 (file)
@@ -203,12 +203,22 @@ Must called from within a `tar-mode' buffer."
     (should (package-installed-p 'simple-single))
     (should (package-installed-p 'simple-depend))))
 
+(ert-deftest package-test-install-two-dependencies ()
+  "Install a package which includes a dependency."
+  (with-package-test ()
+    (package-initialize)
+    (package-refresh-contents)
+    (package-install 'simple-two-depend)
+    (should (package-installed-p 'simple-single))
+    (should (package-installed-p 'simple-depend))
+    (should (package-installed-p 'simple-two-depend))))
+
 (ert-deftest package-test-refresh-contents ()
   "Parse an \"archive-contents\" file."
   (with-package-test ()
     (package-initialize)
     (package-refresh-contents)
-    (should (eq 3 (length package-archive-contents)))))
+    (should (eq 4 (length package-archive-contents)))))
 
 (ert-deftest package-test-install-single-from-archive ()
   "Install a single package from a package archive."