emacs-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: package.el dependencies


From: Artur Malabarba
Subject: Re: package.el dependencies
Date: Mon, 2 Feb 2015 12:56:38 -0200

>> We have now duplicates with package--get-deps:
>>
>> (package--get-deps 'jedi)
>> =>(epc auto-complete python-environment epc auto-complete
>> python-environment
>> concurrent ctable concurrent ctable deferred deferred
>> popup popup deferred deferred)
>>
>> As a workaround, you can use delete-dups, but this need to be
>> implemented differently IMO.
>
> Maybe like this:
>
> diff --git a/lisp/emacs-lisp/package.el b/lisp/emacs-lisp/package.el
> index 9a29d63..2157174 100644
> --- a/lisp/emacs-lisp/package.el
> +++ b/lisp/emacs-lisp/package.el
> @@ -1428,9 +1428,8 @@ The file can either be a tar file or an Emacs Lisp 
> file."
>                                 when (assq name package-alist)
>                                 collect name))
>           (indirect-deps (unless (eq only 'direct)
> -                          (apply #'append
> -                            direct-deps

Yes, I made a mistake by adding the `direct-deps' here. I'll remove it.

> -                            (mapcar #'package--get-deps direct-deps)))))
> +                          (cl-loop for p in direct-deps
> +                                append (package--get-deps p 'direct)))))
>      (cl-case only
>        (direct   direct-deps)
>        (separate (list direct-deps indirect-deps))
>
> (package--get-deps 'jedi)
> => (epc auto-complete python-environment concurrent ctable popup deferred)

It may have solved this particular example, but if two direct
dependencies share the same (indirect) dependency then this will still
lead to duplicates. We could try writting an efficient way of avoiding
this duplicates, but I'm fine with just using `delete-dups'.

And one more thing. Why did you use `(package--get-deps p 'direct)' in
this snippet? Passing the `direct' argument will cause it to only
return 2nd level dependencies at most (direct dependencies of the
direct dependencies). I think it should be just `(package--get-deps
p)', shouldn't it? This way it'll keep searching untill the bottom of
the dependency tree.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]