unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* Package.el and specifying alternative dependencies
@ 2017-03-03  0:41 Tim Cross
  2017-03-04 21:57 ` Mark Oteiza
  2017-03-04 22:46 ` Kaushal Modi
  0 siblings, 2 replies; 8+ messages in thread
From: Tim Cross @ 2017-03-03  0:41 UTC (permalink / raw)
  To: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 853 bytes --]

Is there a way to specify alternative dependencies in a package?

Situation: installing a package is resulting in an additional package being
installed even though the dependencies for the package have already been
satisfied by another package. This results in two packages being installed
which provide overlapping functionality.

Example. I have installed org-plus-contrib. I then install elfeed-org,
which has a dependency on org. This results in the org package being
installed, but org is already installed as part of the org-plus-contrib
package.

I'm trying to work out if this is a problem with how dependencies are
defined in the elfeed-org package or is it a problem with how
org-plus-conrib is specifying what dependency it satisfies? Need to know in
order to determine where this issue needs to be logged.



-- 
regards,

Tim

--
Tim Cross

[-- Attachment #2: Type: text/html, Size: 1179 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Package.el and specifying alternative dependencies
  2017-03-03  0:41 Package.el and specifying alternative dependencies Tim Cross
@ 2017-03-04 21:57 ` Mark Oteiza
  2017-03-04 22:32   ` Tim Cross
  2017-03-04 22:46 ` Kaushal Modi
  1 sibling, 1 reply; 8+ messages in thread
From: Mark Oteiza @ 2017-03-04 21:57 UTC (permalink / raw)
  To: Tim Cross; +Cc: Emacs developers

Tim Cross <theophilusx@gmail.com> writes:

> Is there a way to specify alternative dependencies in a package?
>
> Situation: installing a package is resulting in an additional package being installed
> even though the dependencies for the package have already been satisfied by another
> package. This results in two packages being installed which provide overlapping
> functionality. 
>
> Example. I have installed org-plus-contrib. I then install elfeed-org, which has a
> dependency on org. This results in the org package being installed, but org is
> already installed as part of the org-plus-contrib package. 
>
> I'm trying to work out if this is a problem with how dependencies are defined in the
> elfeed-org package or is it a problem with how org-plus-conrib is specifying what
> dependency it satisfies? Need to know in order to determine where this issue needs to
> be logged.

IIUC, package.el figures out dependencies by package name, not by the
features it provides.  So, I think the answer to your question is no.



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Package.el and specifying alternative dependencies
  2017-03-04 21:57 ` Mark Oteiza
@ 2017-03-04 22:32   ` Tim Cross
  0 siblings, 0 replies; 8+ messages in thread
From: Tim Cross @ 2017-03-04 22:32 UTC (permalink / raw)
  To: Mark Oteiza; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 1666 bytes --]

Yes, that was my conclusion as well. It would seem the problem is really
just because (in this case) we have org and org-plus-contrib as two
packages in the org/elpa repos when really here should just be org and
org-contrib. This would then mean if you have a package which depends on
org, all is good and if you want the contrib stuff, you just install an
additional package with just the contrib additions.  Would also make things
easier with 'helpers' like use-package.

Tim


On 5 March 2017 at 08:57, Mark Oteiza <mvoteiza@udel.edu> wrote:

> Tim Cross <theophilusx@gmail.com> writes:
>
> > Is there a way to specify alternative dependencies in a package?
> >
> > Situation: installing a package is resulting in an additional package
> being installed
> > even though the dependencies for the package have already been satisfied
> by another
> > package. This results in two packages being installed which provide
> overlapping
> > functionality.
> >
> > Example. I have installed org-plus-contrib. I then install elfeed-org,
> which has a
> > dependency on org. This results in the org package being installed, but
> org is
> > already installed as part of the org-plus-contrib package.
> >
> > I'm trying to work out if this is a problem with how dependencies are
> defined in the
> > elfeed-org package or is it a problem with how org-plus-conrib is
> specifying what
> > dependency it satisfies? Need to know in order to determine where this
> issue needs to
> > be logged.
>
> IIUC, package.el figures out dependencies by package name, not by the
> features it provides.  So, I think the answer to your question is no.
>



-- 
regards,

Tim

--
Tim Cross

[-- Attachment #2: Type: text/html, Size: 2370 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Package.el and specifying alternative dependencies
  2017-03-03  0:41 Package.el and specifying alternative dependencies Tim Cross
  2017-03-04 21:57 ` Mark Oteiza
@ 2017-03-04 22:46 ` Kaushal Modi
  2017-03-04 23:44   ` Tim Cross
  1 sibling, 1 reply; 8+ messages in thread
From: Kaushal Modi @ 2017-03-04 22:46 UTC (permalink / raw)
  To: Tim Cross, Emacs developers

[-- Attachment #1: Type: text/plain, Size: 2206 bytes --]

I have this in my config which works very well. I use this just for org :)
I build org from its master branch, so I do not want the dependency check
to auto-install older versions from Elpa.

;; http://emacs.stackexchange.com/a/26513/115
(defun modi/package-dependency-check-ignore (orig-ret)
  "Remove the `black listed packages' from ORIG-RET.
Packages listed in the let-bound `pkg-black-list' will not be auto-installed
even if they are found as dependencies.
It is known that this advice is not effective when installed packages
asynchronously using `paradox'. Below is effective on synchronous
package installations."
  (let ((pkg-black-list '(org))
        new-ret
        pkg-name)
    (dolist (pkg-struct orig-ret)
      (setq pkg-name (package-desc-name pkg-struct))
      (if (member pkg-name pkg-black-list)
          (message (concat "Package `%s' will not be installed. "
                           "See `modi/package-dependency-check-ignore'.")
                   pkg-name)
        ;; (message "Package to be installed: %s" pkg-name)
        (push pkg-struct new-ret)))
    new-ret))
(advice-add 'package-compute-transaction :filter-return
#'modi/package-dependency-check-ignore)

https://github.com/kaushalmodi/.emacs.d/blob/master/setup-packages.el

On Thu, Mar 2, 2017 at 7:41 PM Tim Cross <theophilusx@gmail.com> wrote:

> Is there a way to specify alternative dependencies in a package?
>
> Situation: installing a package is resulting in an additional package
> being installed even though the dependencies for the package have already
> been satisfied by another package. This results in two packages being
> installed which provide overlapping functionality.
>
> Example. I have installed org-plus-contrib. I then install elfeed-org,
> which has a dependency on org. This results in the org package being
> installed, but org is already installed as part of the org-plus-contrib
> package.
>
> I'm trying to work out if this is a problem with how dependencies are
> defined in the elfeed-org package or is it a problem with how
> org-plus-conrib is specifying what dependency it satisfies? Need to know in
> order to determine where this issue needs to be logged.
>
-- 

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 3316 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Package.el and specifying alternative dependencies
  2017-03-04 22:46 ` Kaushal Modi
@ 2017-03-04 23:44   ` Tim Cross
  2017-04-11 22:37     ` Kaushal Modi
  0 siblings, 1 reply; 8+ messages in thread
From: Tim Cross @ 2017-03-04 23:44 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 2427 bytes --]

Nice and useful idea.

thanks

On 5 March 2017 at 09:46, Kaushal Modi <kaushal.modi@gmail.com> wrote:

> I have this in my config which works very well. I use this just for org :)
> I build org from its master branch, so I do not want the dependency check
> to auto-install older versions from Elpa.
>
> ;; http://emacs.stackexchange.com/a/26513/115
> (defun modi/package-dependency-check-ignore (orig-ret)
>   "Remove the `black listed packages' from ORIG-RET.
> Packages listed in the let-bound `pkg-black-list' will not be
> auto-installed
> even if they are found as dependencies.
> It is known that this advice is not effective when installed packages
> asynchronously using `paradox'. Below is effective on synchronous
> package installations."
>   (let ((pkg-black-list '(org))
>         new-ret
>         pkg-name)
>     (dolist (pkg-struct orig-ret)
>       (setq pkg-name (package-desc-name pkg-struct))
>       (if (member pkg-name pkg-black-list)
>           (message (concat "Package `%s' will not be installed. "
>                            "See `modi/package-dependency-check-ignore'.")
>                    pkg-name)
>         ;; (message "Package to be installed: %s" pkg-name)
>         (push pkg-struct new-ret)))
>     new-ret))
> (advice-add 'package-compute-transaction :filter-return
> #'modi/package-dependency-check-ignore)
>
> https://github.com/kaushalmodi/.emacs.d/blob/master/setup-packages.el
>
> On Thu, Mar 2, 2017 at 7:41 PM Tim Cross <theophilusx@gmail.com> wrote:
>
>> Is there a way to specify alternative dependencies in a package?
>>
>> Situation: installing a package is resulting in an additional package
>> being installed even though the dependencies for the package have already
>> been satisfied by another package. This results in two packages being
>> installed which provide overlapping functionality.
>>
>> Example. I have installed org-plus-contrib. I then install elfeed-org,
>> which has a dependency on org. This results in the org package being
>> installed, but org is already installed as part of the org-plus-contrib
>> package.
>>
>> I'm trying to work out if this is a problem with how dependencies are
>> defined in the elfeed-org package or is it a problem with how
>> org-plus-conrib is specifying what dependency it satisfies? Need to know in
>> order to determine where this issue needs to be logged.
>>
> --
>
> Kaushal Modi
>



-- 
regards,

Tim

--
Tim Cross

[-- Attachment #2: Type: text/html, Size: 4352 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Package.el and specifying alternative dependencies
  2017-03-04 23:44   ` Tim Cross
@ 2017-04-11 22:37     ` Kaushal Modi
  2017-04-12  7:35       ` Tim Cross
  2017-04-12  7:44       ` Thien-Thi Nguyen
  0 siblings, 2 replies; 8+ messages in thread
From: Kaushal Modi @ 2017-04-11 22:37 UTC (permalink / raw)
  To: Tim Cross; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 4425 bytes --]

Hi Tim,

I just discovered a bug in this advice.. I needed to fix the order of
packages in the new-ret list that is returned. The bug was that the order
of pkgs in new-ret was flipped compared to that in orig-ret.. so I needed
to flip it back using reverse.

Here is the fixed function:

;; http://emacs.stackexchange.com/a/26513/115
(defun modi/package-dependency-check-ignore (orig-ret)
  "Remove the `black listed packages' from ORIG-RET.

Packages listed in the let-bound `pkg-black-list' will not be auto-installed
even if they are found as dependencies.

It is known that this advice is not effective when installed packages
asynchronously using `paradox'. Below is effective on synchronous
package installations."
  (let ((pkg-black-list '(org))
        new-ret
        pkg-name)
    (dolist (pkg-struct orig-ret)
      (setq pkg-name (package-desc-name pkg-struct))
      (if (member pkg-name pkg-black-list)
          (message (concat "Package `%s' will not be installed. "
                           "See `modi/package-dependency-check-ignore'.")
                   pkg-name)
        (push pkg-struct new-ret)))
    ;; Tue Apr 11 17:48:16 EDT 2017 - kmodi
    ;; It's *very* critical that the order of packages stays the same in
NEW-RET
    ;; as in ORIG-RET. The `push' command flips the order, so use `reverse'
    ;; to flip the order back to the original.
    ;;   Without this step, you will get errors like below when installing
    ;; packages with dependencies:
    ;;   Debugger entered--Lisp error: (error "Unable to activate package
‘nim-mode’.
    ;;   Required package ‘flycheck-28’ is unavailable")
    (setq new-ret (reverse new-ret))
    new-ret))
(advice-add 'package-compute-transaction :filter-return
#'modi/package-dependency-check-ignore)

On Sat, Mar 4, 2017 at 6:44 PM Tim Cross <theophilusx@gmail.com> wrote:

> Nice and useful idea.
>
> thanks
>
> On 5 March 2017 at 09:46, Kaushal Modi <kaushal.modi@gmail.com> wrote:
>
> I have this in my config which works very well. I use this just for org :)
> I build org from its master branch, so I do not want the dependency check
> to auto-install older versions from Elpa.
>
> ;; http://emacs.stackexchange.com/a/26513/115
> (defun modi/package-dependency-check-ignore (orig-ret)
>   "Remove the `black listed packages' from ORIG-RET.
> Packages listed in the let-bound `pkg-black-list' will not be
> auto-installed
> even if they are found as dependencies.
> It is known that this advice is not effective when installed packages
> asynchronously using `paradox'. Below is effective on synchronous
> package installations."
>   (let ((pkg-black-list '(org))
>         new-ret
>         pkg-name)
>     (dolist (pkg-struct orig-ret)
>       (setq pkg-name (package-desc-name pkg-struct))
>       (if (member pkg-name pkg-black-list)
>           (message (concat "Package `%s' will not be installed. "
>                            "See `modi/package-dependency-check-ignore'.")
>                    pkg-name)
>         ;; (message "Package to be installed: %s" pkg-name)
>         (push pkg-struct new-ret)))
>     new-ret))
> (advice-add 'package-compute-transaction :filter-return
> #'modi/package-dependency-check-ignore)
>
> https://github.com/kaushalmodi/.emacs.d/blob/master/setup-packages.el
>
> On Thu, Mar 2, 2017 at 7:41 PM Tim Cross <theophilusx@gmail.com> wrote:
>
> Is there a way to specify alternative dependencies in a package?
>
> Situation: installing a package is resulting in an additional package
> being installed even though the dependencies for the package have already
> been satisfied by another package. This results in two packages being
> installed which provide overlapping functionality.
>
> Example. I have installed org-plus-contrib. I then install elfeed-org,
> which has a dependency on org. This results in the org package being
> installed, but org is already installed as part of the org-plus-contrib
> package.
>
> I'm trying to work out if this is a problem with how dependencies are
> defined in the elfeed-org package or is it a problem with how
> org-plus-conrib is specifying what dependency it satisfies? Need to know in
> order to determine where this issue needs to be logged.
>
> --
>
> Kaushal Modi
>
>
>
>
> --
> regards,
>
> Tim
>
> --
> Tim Cross
>
> --

Kaushal Modi

[-- Attachment #2: Type: text/html, Size: 9710 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Package.el and specifying alternative dependencies
  2017-04-11 22:37     ` Kaushal Modi
@ 2017-04-12  7:35       ` Tim Cross
  2017-04-12  7:44       ` Thien-Thi Nguyen
  1 sibling, 0 replies; 8+ messages in thread
From: Tim Cross @ 2017-04-12  7:35 UTC (permalink / raw)
  To: Kaushal Modi; +Cc: Emacs developers

[-- Attachment #1: Type: text/plain, Size: 4743 bytes --]

Thanks for the update.

Tim

On 12 April 2017 at 08:37, Kaushal Modi <kaushal.modi@gmail.com> wrote:

> Hi Tim,
>
> I just discovered a bug in this advice.. I needed to fix the order of
> packages in the new-ret list that is returned. The bug was that the order
> of pkgs in new-ret was flipped compared to that in orig-ret.. so I needed
> to flip it back using reverse.
>
> Here is the fixed function:
>
> ;; http://emacs.stackexchange.com/a/26513/115
> (defun modi/package-dependency-check-ignore (orig-ret)
>   "Remove the `black listed packages' from ORIG-RET.
>
> Packages listed in the let-bound `pkg-black-list' will not be
> auto-installed
> even if they are found as dependencies.
>
> It is known that this advice is not effective when installed packages
> asynchronously using `paradox'. Below is effective on synchronous
> package installations."
>   (let ((pkg-black-list '(org))
>         new-ret
>         pkg-name)
>     (dolist (pkg-struct orig-ret)
>       (setq pkg-name (package-desc-name pkg-struct))
>       (if (member pkg-name pkg-black-list)
>           (message (concat "Package `%s' will not be installed. "
>                            "See `modi/package-dependency-check-ignore'.")
>                    pkg-name)
>         (push pkg-struct new-ret)))
>     ;; Tue Apr 11 17:48:16 EDT 2017 - kmodi
>     ;; It's *very* critical that the order of packages stays the same in
> NEW-RET
>     ;; as in ORIG-RET. The `push' command flips the order, so use `reverse'
>     ;; to flip the order back to the original.
>     ;;   Without this step, you will get errors like below when installing
>     ;; packages with dependencies:
>     ;;   Debugger entered--Lisp error: (error "Unable to activate package
> ‘nim-mode’.
>     ;;   Required package ‘flycheck-28’ is unavailable")
>     (setq new-ret (reverse new-ret))
>     new-ret))
> (advice-add 'package-compute-transaction :filter-return
> #'modi/package-dependency-check-ignore)
>
> On Sat, Mar 4, 2017 at 6:44 PM Tim Cross <theophilusx@gmail.com> wrote:
>
>> Nice and useful idea.
>>
>> thanks
>>
>> On 5 March 2017 at 09:46, Kaushal Modi <kaushal.modi@gmail.com> wrote:
>>
>> I have this in my config which works very well. I use this just for org
>> :) I build org from its master branch, so I do not want the dependency
>> check to auto-install older versions from Elpa.
>>
>> ;; http://emacs.stackexchange.com/a/26513/115
>> (defun modi/package-dependency-check-ignore (orig-ret)
>>   "Remove the `black listed packages' from ORIG-RET.
>> Packages listed in the let-bound `pkg-black-list' will not be
>> auto-installed
>> even if they are found as dependencies.
>> It is known that this advice is not effective when installed packages
>> asynchronously using `paradox'. Below is effective on synchronous
>> package installations."
>>   (let ((pkg-black-list '(org))
>>         new-ret
>>         pkg-name)
>>     (dolist (pkg-struct orig-ret)
>>       (setq pkg-name (package-desc-name pkg-struct))
>>       (if (member pkg-name pkg-black-list)
>>           (message (concat "Package `%s' will not be installed. "
>>                            "See `modi/package-dependency-check-ignore'.")
>>                    pkg-name)
>>         ;; (message "Package to be installed: %s" pkg-name)
>>         (push pkg-struct new-ret)))
>>     new-ret))
>> (advice-add 'package-compute-transaction :filter-return
>> #'modi/package-dependency-check-ignore)
>>
>> https://github.com/kaushalmodi/.emacs.d/blob/master/setup-packages.el
>>
>> On Thu, Mar 2, 2017 at 7:41 PM Tim Cross <theophilusx@gmail.com> wrote:
>>
>> Is there a way to specify alternative dependencies in a package?
>>
>> Situation: installing a package is resulting in an additional package
>> being installed even though the dependencies for the package have already
>> been satisfied by another package. This results in two packages being
>> installed which provide overlapping functionality.
>>
>> Example. I have installed org-plus-contrib. I then install elfeed-org,
>> which has a dependency on org. This results in the org package being
>> installed, but org is already installed as part of the org-plus-contrib
>> package.
>>
>> I'm trying to work out if this is a problem with how dependencies are
>> defined in the elfeed-org package or is it a problem with how
>> org-plus-conrib is specifying what dependency it satisfies? Need to know in
>> order to determine where this issue needs to be logged.
>>
>> --
>>
>> Kaushal Modi
>>
>>
>>
>>
>> --
>> regards,
>>
>> Tim
>>
>> --
>> Tim Cross
>>
>> --
>
> Kaushal Modi
>



-- 
regards,

Tim

--
Tim Cross

[-- Attachment #2: Type: text/html, Size: 12613 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Package.el and specifying alternative dependencies
  2017-04-11 22:37     ` Kaushal Modi
  2017-04-12  7:35       ` Tim Cross
@ 2017-04-12  7:44       ` Thien-Thi Nguyen
  1 sibling, 0 replies; 8+ messages in thread
From: Thien-Thi Nguyen @ 2017-04-12  7:44 UTC (permalink / raw)
  To: emacs-devel

[-- Attachment #1: Type: text/plain, Size: 987 bytes --]


() Kaushal Modi <kaushal.modi@gmail.com>
() Tue, 11 Apr 2017 22:37:29 +0000

       ;; It's *very* critical that the order of packages stays
       ;; the same in NEW-RET as in ORIG-RET. The `push' command
       ;; flips the order, so use `reverse' to flip the order
       ;; back to the original.

If you don't mind ‘cl’, you can also use ‘cl-remove-if’ instead.
Squinting a little, i see the removal predicate is essentially
set membership, which seems to indicate ‘cl-set-difference’.
Unfortunately, a quick scan of (info "(cl) Lists as Sets")
reveals no guarantees on order, and Common Lisp (per CLHS)
actively disclaims such guarantees.  So it goes...

-- 
Thien-Thi Nguyen -----------------------------------------------
 (defun responsep (query)
   (pcase (context query)
     (`(technical ,ml) (correctp ml))
     ...))                              748E A0E8 1CB8 A748 9BFA
--------------------------------------- 6CE4 6703 2224 4C80 7502


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2017-04-12  7:44 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-03  0:41 Package.el and specifying alternative dependencies Tim Cross
2017-03-04 21:57 ` Mark Oteiza
2017-03-04 22:32   ` Tim Cross
2017-03-04 22:46 ` Kaushal Modi
2017-03-04 23:44   ` Tim Cross
2017-04-11 22:37     ` Kaushal Modi
2017-04-12  7:35       ` Tim Cross
2017-04-12  7:44       ` Thien-Thi Nguyen

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).