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

Invalid build option warnings - supersedes #1088 #1217

Merged
merged 5 commits into from
Nov 13, 2016

Conversation

MatzFan
Copy link
Contributor

@MatzFan MatzFan commented Oct 3, 2016

  • [ √] Have you followed the guidelines in our Contributing document?
  • [√ ] Have you checked to ensure there aren't other open Pull Requests for the same change?
    Note this PR supersedes warning only functionality #1088
  • [ √] Have you added an explanation of what your changes do and why you'd like us to include them?
  • [√ ] Have you written new tests for your changes? Here's an example.
  • [√ ] Have you successfully run brew tests with your changes locally?
    Be grateful if someone could explain how to do this in a forked repo outside of /usr/local/Homebrew 😄

Copy link
Member

@MikeMcQuaid MikeMcQuaid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A few final nits but this is looking good locally, nice work!

@args - @options
end

def invalid_option_names
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Make this @private too, thanks!

@@ -32,7 +32,7 @@ def self.mode_attr_accessor(*names)
end

attr_reader :formula
attr_accessor :options, :build_bottle
attr_accessor :options, :build_bottle, :invalid_opt_names
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's call this invalid_option_names

@@ -214,6 +215,10 @@ def install
opoo "#{formula.full_name}: #{old_flag} was deprecated; using #{new_flag} instead!"
end

invalid_opt_names.each do |option|
opoo "#{formula.full_name}: #{option} is invalid for this formula and will be ignored!"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opoo "#{formula.full_name}: this formula has no #{option} option so it will be ignored!"

@MikeMcQuaid
Copy link
Member

Just a heads up that #1488 may affect this PR. Let me know your thoughts.

fi.options = f.build.used_options
build_options = f.build
fi.options = build_options.used_options
fi.invalid_opt_names = build_options.invalid_option_names
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

fi.invalid_option_names

@@ -261,7 +261,9 @@ def install_formula(f)
f.print_tap_action

fi = FormulaInstaller.new(f)
fi.options = f.build.used_options
build_options = f.build
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull this above the fi definition like in reinstall.rb to make it clearer and don't indent it.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, wondering if we'll want anything like this in reinstall or upgrade? I figure probably not but worth thinking about.

@MatzFan
Copy link
Contributor Author

MatzFan commented Nov 12, 2016

Will have to look at #1488 - can't see right away what it does. Thx for heads up tho. Also, sorry for deleting original branch for this change - a learning experience

@MikeMcQuaid
Copy link
Member

@MatzFan Actually, I looked and it's ok; you are touching install, I'm touching reinstall, upgrade and dependencies. We're all good 👍

@MikeMcQuaid MikeMcQuaid merged commit 2a53d14 into Homebrew:master Nov 13, 2016
@MikeMcQuaid
Copy link
Member

Thanks for your contribution to Homebrew! Without people like you submitting PRs we couldn't run this project. You rock!

@Homebrew Homebrew locked and limited conversation to collaborators May 3, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants