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

When running the choco outdated command the wrong exit code is shown when there is a pinned package and the --ignore-pinned option is being used #1896

Closed
kintrupf opened this issue Aug 9, 2019 · 2 comments · Fixed by #2532
Assignees
Labels
5 - Released Bug IN REGRESSION TEST SUITE These are things that are handled by tools like Test-Kitchen
Milestone

Comments

@kintrupf
Copy link

kintrupf commented Aug 9, 2019

When I use the command "choco outdated --ignore-pinned" to get a list of available, non-pinned upgrades I'll still get the exit code 2 when only pinned packages have upgrades available.

This is unexpected, since the command does not list the pinned packages (as I asked it not to do).
"choco outdated --ignore-pinned" should only return 2 when a non-pinned packages have upgrades available, otherwise it should return 0.

The output on my console to demonstrate the problem:

[C:]choco outdated --ignore-pinned
Chocolatey v0.10.15
Outdated Packages
Output is package name | current version | available version | pinned?

Chocolatey has determined 0 package(s) are outdated.

[C:]echo %errorlevel%
2

[C:]

@ferventcoder ferventcoder self-assigned this Aug 16, 2019
@ferventcoder ferventcoder added this to the 0.10.16 milestone Aug 16, 2019
@ferventcoder
Copy link
Member

This looks like a bug - thanks for pointing that out.

@ferventcoder ferventcoder changed the title choco outdated wrong exitcode with --ignore-pinned outdated - calling --ignore-pinned still counts pinned packages in exit code Aug 16, 2019
@styleah
Copy link

styleah commented Sep 20, 2019

Do you know when this bug will be fixed ?

@pauby pauby modified the milestones: 0.10.16, 0.10.x May 11, 2021
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 17, 2022
…it code

If there are no outdated unpinned packages, but there are are outdated
pinned packages, then an enhanced exit code of 2 will be incorrectly
used, while it should be an exit code of 0. This assumes enhanced exit
codes are enabled.

This corrects the check for if exit code 2 should be used to only
include unpinned packages, like the log output does.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Jan 17, 2022
…it code

If there are no outdated unpinned packages, but there are are outdated
pinned packages, then an enhanced exit code of 2 will be incorrectly
used, while it should be an exit code of 0. This assumes enhanced exit
codes are enabled.

This corrects the check for if exit code 2 should be used to only
include unpinned packages, like the log output does.
TheCakeIsNaOH added a commit to TheCakeIsNaOH/choco that referenced this issue Mar 21, 2022
…it code

If there are no outdated unpinned packages, but there are are outdated
pinned packages, then an enhanced exit code of 2 will be incorrectly
used, while it should be an exit code of 0. This assumes enhanced exit
codes are enabled.

This corrects the check for if exit code 2 should be used to only
include unpinned packages, like the log output does.
@pauby pauby modified the milestones: 0.11.x, 1.1.0 Mar 24, 2022
gep13 pushed a commit to TheCakeIsNaOH/choco that referenced this issue Mar 25, 2022
…it code

If there are no outdated unpinned packages, but there are are outdated
pinned packages, then an enhanced exit code of 2 will be incorrectly
used, while it should be an exit code of 0. This assumes enhanced exit
codes are enabled.

This corrects the check for if exit code 2 should be used to only
include unpinned packages, like the log output does.
gep13 added a commit that referenced this issue Mar 25, 2022
(#1896) Outdated with ignore-pinned use correct enhanced exit code
@gep13 gep13 added 4 - Done ADD AUTO TESTS Things that typically go to Test-Kitchen - once completed, IN REGRESSION TEST SUITE label added and removed 3 - Review labels Mar 25, 2022
@corbob corbob added IN REGRESSION TEST SUITE These are things that are handled by tools like Test-Kitchen and removed ADD AUTO TESTS Things that typically go to Test-Kitchen - once completed, IN REGRESSION TEST SUITE label added labels Mar 25, 2022
@gep13 gep13 changed the title outdated - calling --ignore-pinned still counts pinned packages in exit code When running the choco outdated command the wrong exit code is shown when there is a pinned package and the --ignore-pinned option is being used Mar 29, 2022
gep13 added a commit that referenced this issue Mar 30, 2022
* release/1.1.0: (22 commits)
  (#2659) Handle scenario where install has no buffer
  (version) v1.1.0-beta
  (maint) Remove unnecessary whitespace
  (#2660) Only show warnings when using license
  (#2659) Add licensed extension detection on install
  (maint) Tidy up existing script format
  (#2660) Expand Tab completion for new options
  (#2660) Add runtime check for compatible versions
  (maint) Remove whitespace and fix formatting
  (#2650) Upgrade 7z to 21.07
  (#2663) Check file signature on 6 bytes
  (version) 1.1.0-alpha
  (#2083) Use correct formatting
  (#2083) Support installation using PowerShell Core
  (#1896) Outdated with ignore-pinned use correct enhanced exit code
  (maint) typo outdated -> outdated
  (maint) Remove unnecessary using statement
  (#2525) Close config file before we try to copy
  (#2540) Python source disable all keyword on upgrade
  (maint) formatting
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
5 - Released Bug IN REGRESSION TEST SUITE These are things that are handled by tools like Test-Kitchen
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants