-
-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
Invalid build option warnings - supersedes #1088 #1217
Conversation
There was a problem hiding this 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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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!" |
There was a problem hiding this comment.
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!"
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 |
There was a problem hiding this comment.
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 |
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
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.
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 |
@MatzFan Actually, I looked and it's ok; you are touching |
Thanks for your contribution to Homebrew! Without people like you submitting PRs we couldn't run this project. You rock! |
Note this PR supersedes warning only functionality #1088
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 😄