Installing formula and specifying dependency after fails #16957

Closed
MikeMcQuaid opened this Issue Jan 8, 2013 · 7 comments

Projects

None yet

3 participants

@MikeMcQuaid
Member
brew install graphviz pkg-config
Installing graphviz dependency: pkg-config
==> Installing graphviz
Error: pkg-config-0.27.1 already installed

(More here: https://gist.github.com/4484892)

This doesn't really matter in the short term as it can be safely ignored but I need to fix it for brew-test-bot which relies on the exit code here. Thought it was interesting enough to make it worth filing.

@adamv
Contributor
adamv commented Jan 8, 2013

Yeah, this shouldn't be an "error".

@MikeMcQuaid
Member

Personally I don't think 'already installed' should ever be an error but instead a noop.

@jacknagel
Contributor

Indeed, I already encountered and dealt with this in upgrade when working on my deps branch. I made a note to port the fix to install.

@adamv
Contributor
adamv commented Jan 9, 2013

Should I just pull this or what?

@jacknagel
Contributor

Was hoping to hear "it doesn't seem to have broken other stuff"

@jacknagel jacknagel added a commit that closed this issue Jan 10, 2013
@jacknagel jacknagel Don't attempt installation multiple times
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.

For example:

  $ brew install graphviz pkg-config
  ==> Installing graphviz dependency: pkg-config
  ...
  ==> Installing graphviz
  ...
  Error: pkg-config-0.27.1 already installed

We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.

Fixes #16957.
30a08f5
@jacknagel jacknagel closed this in 30a08f5 Jan 10, 2013
@jacknagel
Contributor

Pulled the fix.

@Sharpie Sharpie pushed a commit to Sharpie/homebrew that referenced this issue Jan 11, 2013
@jacknagel jacknagel Don't attempt installation multiple times
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.

For example:

  $ brew install graphviz pkg-config
  ==> Installing graphviz dependency: pkg-config
  ...
  ==> Installing graphviz
  ...
  Error: pkg-config-0.27.1 already installed

We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.

Fixes #16957.
e820d6a
@dholm dholm added a commit to dholm/homebrew that referenced this issue Jan 14, 2013
@jacknagel @dholm jacknagel + dholm Don't attempt installation multiple times
When a dependency of a formula specified on the command-line is also
specified, *after* the dependent formula, installation proceeds as part
of the dependent's dependency tree and then is attempted again because
the user asked for it explicitly. This results in the installer raising
a CannotInstallFormulaError because it has already been installed.

For example:

  $ brew install graphviz pkg-config
  ==> Installing graphviz dependency: pkg-config
  ...
  ==> Installing graphviz
  ...
  Error: pkg-config-0.27.1 already installed

We already have a mechanism for dealing with this, but it does not kick
in early enough. Move the installation attempt check into
FormulaInstaller#check_install_sanity and catch the exception in the
appropriate places.

Fixes #16957.
3fe686d
@xu-cheng xu-cheng locked and limited conversation to collaborators Feb 16, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.