Handle different output formats of "choco upgrade" command - #385
Open
fraenki wants to merge 2 commits into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The first commit fixes #382:
choco upgrade --noop <pkg> -rreturns 3 pipe-delimited fields when no update is available (name|current|pinned) and 4 fields when one is (name|current|available|pinned). The provider'slatestmethod always readvalues[2], so for up-to-date packages it returned the pinned flag ("false") as the version, causing spurious noop changes.The second commit fixes #380:
Previously
latestcould return an empty string, nil, or a non-version string (e.g. thepinnedflag bleeding into the version slot) when the source produced output that didn't match the documented machine-readable format. Puppet's package type then sawis != @latest, calledprovider.update, and ran choco again against the broken source.Both fixes modify the same code, so in order to avoid conflicting PRs, I've added both fixes to this PR.
Additional Context
see #382 and #380
Related Issues (if any)
#382
#380
Checklist
puppet apply)