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

Unshadow `allow_untrusted` option for pkg artifact #3256

Merged
merged 1 commit into from Oct 3, 2017

Conversation

Projects
None yet
2 participants
@claui
Member

claui commented Oct 1, 2017

The pkg stanza has an option called allow_untrusted, which is supposed to cause /usr/sbin/installer to be called with the -allowUntrusted switch.

PR #3141 seems to have renamed the pkg_install_opts field to options. At the same time, it introduces an options parameter for the run_installer method, which shadows the options getter method, causing the allow_untrusted option to be silently ignored.

The issue affects just the pkg stanza because Hbc::Artifact::Pkg is the only artifact class that has an options method.

This PR removes the shadowing by renaming the method parameters by renaming the field to stanza_options; in one case, it uses ignored_install_options _options for a parameter name (instead of the more canonical _) for the sake of clarity.

Edit: last paragraph as per @reitermarkus’s suggestions.

Unshadow `allow_untrusted` option for pkg artifact
The pkg stanza has an option called `allow_untrusted`, which is
supposed to cause `/usr/sbin/installer` to be called with the
`-allowUntrusted` switch.

PR #3141 seems to have renamed the `pkg_install_opts` field to
`options`. At the same time, it introduces an `options` parameter for
the `run_installer` method, which shadows the `options` getter
method, causing the `allow_untrusted` option to be silently ignored.

The issue affects just the `pkg` stanza because `Hbc::Artifact::Pkg`
is the only artifact class that has an `options` method.

This commit removes the shadowing by renaming the field to
`stanza_options`; in one case, it uses `_options` for a parameter
name (instead of the more canonical `_`) for the sake of clarity.
@reitermarkus

I realize my argument is pretty much void.

Thanks for fixing this, @claui!

@reitermarkus reitermarkus merged commit 7ee86cf into Homebrew:master Oct 3, 2017

3 checks passed

codecov/patch 90% of diff hit (target 67.12%)
Details
codecov/project 67.13% (+0.01%) compared to e7cf509
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details

@claui claui deleted the claui:pkg-unshadow-options branch Oct 3, 2017

@claui

This comment has been minimized.

Show comment
Hide comment
@claui

claui Oct 3, 2017

Member

Thanks for being rigorous with your reviews. I appreciate that a lot 👍

Member

claui commented Oct 3, 2017

Thanks for being rigorous with your reviews. I appreciate that a lot 👍

@Homebrew Homebrew locked and limited conversation to collaborators May 4, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.