diff options
| author | Charlie Sharpsteen | 2011-11-26 21:03:46 -0800 |
|---|---|---|
| committer | Charlie Sharpsteen | 2011-11-27 14:37:31 -0800 |
| commit | b5f942764a58c1a04e04de83e94eb59a915ee3cb (patch) | |
| tree | e9de60f8fd6e267122c06a09dafe35ac59e285f3 /Library/Homebrew/cmd | |
| parent | 9ecb2ceb299b771eb3710aea3747f3112d5af45c (diff) | |
| download | brew-b5f942764a58c1a04e04de83e94eb59a915ee3cb.tar.bz2 | |
Re-work ARGV filtering to properly handle --HEAD
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/homebrew#8668.
Closes Homebrew/homebrew#7724.
Diffstat (limited to 'Library/Homebrew/cmd')
| -rw-r--r-- | Library/Homebrew/cmd/install.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Library/Homebrew/cmd/install.rb b/Library/Homebrew/cmd/install.rb index 7142a5fcb..2848986d4 100644 --- a/Library/Homebrew/cmd/install.rb +++ b/Library/Homebrew/cmd/install.rb @@ -84,6 +84,10 @@ module Homebrew extend self unless formulae.empty? perform_preinstall_checks formulae.each do |f| + # Check formula status and skip if necessary---a formula passed on the + # command line may have been installed to satisfy a dependency. + next if f.installed? + begin fi = FormulaInstaller.new(f) fi.install |
