Skip to content
This repository has been archived by the owner on Jan 16, 2025. It is now read-only.

brew install --HEAD should not install --HEAD deps #7724

Closed
mxcl opened this issue Sep 20, 2011 · 6 comments
Closed

brew install --HEAD should not install --HEAD deps #7724

mxcl opened this issue Sep 20, 2011 · 6 comments
Labels

Comments

@mxcl
Copy link
Contributor

mxcl commented Sep 20, 2011

If I have libevent installed brew install io works as expected. If I use --HEAD brew tries to install libevent HEAD too.

I'm not sure that this is desired.

@jacknagel
Copy link
Contributor

Agreed, someone pointed this out recently but I forgot about it.

@Sharpie
Copy link
Contributor

Sharpie commented Sep 20, 2011

I suppose we could remove --HEAD from ARGV (or clear ARGV entirely) when fork is called to install a formula, unless the formula name was explicitly passed by the user to brew install or upgrade or whatever.

@mxcl
Copy link
Contributor Author

mxcl commented Sep 20, 2011

Good thinking, though we shouldn't clear eg. --verbose or --debug.

@Sharpie
Copy link
Contributor

Sharpie commented Sep 22, 2011

Took a stab at a fix in Sharpie/homebrew@ac00541 . Let me know if it looks promising.

@Sharpie
Copy link
Contributor

Sharpie commented Sep 23, 2011

Sharpie/homebrew@ac00541 has been incorporated in pull request #7784.

@Sharpie
Copy link
Contributor

Sharpie commented Nov 13, 2011

Flags are now filtered by code in formula_installer.rb:

https://github.com/mxcl/homebrew/blob/7148211304/Library/Homebrew/formula_installer.rb#L257

Feel free to adjust the list of filtered flags as needed.

wrigleyster pushed a commit to wrigleyster/homebrew that referenced this issue Nov 17, 2011
`ARVG` is now filtered before the formula installer forks a new process. This
allows a chance to do things like strip out `--HEAD` flags for formulae that
weren't explicitly passed as arguments but came in as dependencies.

Fixes Homebrew#7724.
@Sharpie Sharpie reopened this Nov 21, 2011
etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 24, 2011
`ARVG` is now filtered before the formula installer forks a new process. This
allows a chance to do things like strip out `--HEAD` flags for formulae that
weren't explicitly passed as arguments but came in as dependencies.

Fixes Homebrew#7724.
etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 24, 2011
Previously, stripping arguments like `--HEAD` for dependencies failed because
that flag affects the installation prefix encoded into formula objects. The
previous implementation of `ARGV` filtering tried to contain all changes to a
single method call before the `FormulaInstaller` forks. This update spreads
things out a bit:

  - The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies`
    which strips flags like `--HEAD`, yields to a block, then restores the
    original contents of ARGV.

  - The `explicitly_requested?` test, which returns true or false depending on
    if a formula object is a member of `ARGV.formulae`, is now a method of
    `Formula` objects.

  - `FormulaInstaller` objects now execute the installation of dependencies
    inside an `ARGV.filter_for_dependencies` block if the dependency was
    `explicitly_requested?`.

Fixes Homebrew#8668.
Closes Homebrew#7724.
etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 27, 2011
`ARVG` is now filtered before the formula installer forks a new process. This
allows a chance to do things like strip out `--HEAD` flags for formulae that
weren't explicitly passed as arguments but came in as dependencies.

Fixes Homebrew#7724.
etehtsea pushed a commit to etehtsea/homebrew that referenced this issue Dec 27, 2011
Previously, stripping arguments like `--HEAD` for dependencies failed because
that flag affects the installation prefix encoded into formula objects. The
previous implementation of `ARGV` filtering tried to contain all changes to a
single method call before the `FormulaInstaller` forks. This update spreads
things out a bit:

  - The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies`
    which strips flags like `--HEAD`, yields to a block, then restores the
    original contents of ARGV.

  - The `explicitly_requested?` test, which returns true or false depending on
    if a formula object is a member of `ARGV.formulae`, is now a method of
    `Formula` objects.

  - `FormulaInstaller` objects now execute the installation of dependencies
    inside an `ARGV.filter_for_dependencies` block if the dependency was
    `explicitly_requested?`.

Fixes Homebrew#8668.
Closes Homebrew#7724.
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
`ARVG` is now filtered before the formula installer forks a new process. This
allows a chance to do things like strip out `--HEAD` flags for formulae that
weren't explicitly passed as arguments but came in as dependencies.

Fixes Homebrew#7724.
snakeyroc3 pushed a commit to snakeyroc3/homebrew that referenced this issue Dec 17, 2012
Previously, stripping arguments like `--HEAD` for dependencies failed because
that flag affects the installation prefix encoded into formula objects. The
previous implementation of `ARGV` filtering tried to contain all changes to a
single method call before the `FormulaInstaller` forks. This update spreads
things out a bit:

  - The Homebrew `ARGV` extension adds a new method, `filter_for_dependencies`
    which strips flags like `--HEAD`, yields to a block, then restores the
    original contents of ARGV.

  - The `explicitly_requested?` test, which returns true or false depending on
    if a formula object is a member of `ARGV.formulae`, is now a method of
    `Formula` objects.

  - `FormulaInstaller` objects now execute the installation of dependencies
    inside an `ARGV.filter_for_dependencies` block if the dependency was
    `explicitly_requested?`.

Fixes Homebrew#8668.
Closes Homebrew#7724.
@Homebrew Homebrew 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.
Labels
Projects
None yet
Development

No branches or pull requests

3 participants