Subject: Re: bug#14082: 24.3; Package dependences calculated in reverse

From: Donald Curtis <[email-masked]>
Date: Fri, 5 Apr 2013 10:27:38 -0500

It appears the bug is still happening because if the package already exists then the new code will not get called because it is wrapped in the `unless'. The following patch works perfectly for me. It just always adds the package to the front.

diff --git a/package.el.orig b/package.el
index ab17ec1..064e1db 100644
--- a/package.el.orig
+++ b/package.el
@@ -810,11 +810,10 @@ but version %s required"
              (symbol-name next-pkg) (package-version-join next-version)
              (package-version-join (package-desc-vers (cdr pkg-desc)))))
           ;; Only add to the transaction if we don't already have it.
-          (unless (memq next-pkg package-list)
-            (setq package-list
-                  ;; Move to front, so it gets installed early enough
-                  ;; (bug#14082).
-                  (cons next-pkg (delq next-pkg package-list))))
+          (setq package-list
+                ;; Move to front, so it gets installed early enough
+                ;; (bug#14082).
+                (cons next-pkg (delq next-pkg package-list)))
           (setq package-list
                 (package-compute-transaction package-list
                                              (package-desc-reqs

	Donald

On Apr 3, 2013, at 21:46, Stefan Monnier <[email-masked]> wrote:

>> * rinari requires: ruby-mode, inf-ruby, ruby-compilation, jump
>> * jump requires: findr, inflections
>> * ruby-compilation requires: inf-ruby
> 
>> Yet, the order of compilation appears to be:
> 
>> 1. inflections
>> 2. findr
>> 3. jump
>> 4. ruby-compilation *fails missing inf-ruby*
> 
> Indeed, thanks.  I installed the patch below which should fix
> this problem.  Note that a better fix would be to first download packages,
> the unpack packages, then autoload packages, then compile packages.
> This way, ordering won't matter (including circular dependencies).
> 
> 
>        Stefan
> 
> 
> === modified file 'lisp/emacs-lisp/package.el'
> --- lisp/emacs-lisp/package.el	2013-04-04 01:51:33 +0000
> +++ lisp/emacs-lisp/package.el	2013-04-04 02:42:31 +0000
> @@ -811,7 +811,10 @@
> 	     (package-version-join (package-desc-vers (cdr pkg-desc)))))
> 	  ;; Only add to the transaction if we don't already have it.
> 	  (unless (memq next-pkg package-list)
> -	    (push next-pkg package-list))
> +            (setq package-list
> +                  ;; Move to front, so it gets installed early enough
> +                  ;; (bug#14082).
> +                  (cons next-pkg (delq next-pkg package-list))))
> 	  (setq package-list
> 		(package-compute-transaction package-list
> 					     (package-desc-reqs
>