Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Filter formula build options based on those that exist. #1488

Merged
merged 1 commit into from
Nov 13, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Filter formula build options based on those that exist.
If `--with-foo` is provided to a formula through a tab or through
another formula depending on it and this option does not exist it
should be filtered. If it is not (the prior behaviour) then this can
prevent bottles being used unnecessarily.

Fixes #1399.
  • Loading branch information
MikeMcQuaid committed Nov 12, 2016
commit 56124f5963686be214b8dd6c02628c5ddbd37154
1 change: 1 addition & 0 deletions Library/Homebrew/cmd/reinstall.rb
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ def reinstall
def reinstall_formula(f)
options = BuildOptions.new(Options.create(ARGV.flags_only), f.options).used_options
options |= f.build.used_options
options &= f.options

notice = "Reinstalling #{f.full_name}"
notice += " with #{options * ", "}" unless options.empty?
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/cmd/upgrade.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ def upgrade_formula(f)

fi = FormulaInstaller.new(f)
fi.options = f.build.used_options
fi.options &= f.options
fi.build_bottle = ARGV.build_bottle? || (!f.bottled? && f.build.build_bottle?)
fi.build_from_source = ARGV.build_from_source? || ARGV.build_all_from_source?
fi.verbose = ARGV.verbose?
Expand Down
1 change: 1 addition & 0 deletions Library/Homebrew/formula_installer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,7 @@ def install_dependency(dep, inherited_options)
fi.options |= tab.used_options
fi.options |= Tab.remap_deprecated_options(df.deprecated_options, dep.options)
fi.options |= inherited_options
fi.options &= df.options
fi.build_from_source = ARGV.build_formula_from_source?(df)
fi.verbose = verbose? && !quieter?
fi.debug = debug?
Expand Down