-
Notifications
You must be signed in to change notification settings - Fork 906
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
choco list -e -a
returns pre-releases even when --pre
is not passed
#2304
Comments
Might be related to #1843 |
I think we need to clarify if |
Without |
Due to a prior fix in the logic for `list -e -a`, all packages with the target ID were being returned, regardless of whether the user uses the `--pre` flag or not. Since the same search without `--exact` does not return prerelease versions unless the `--pre` option is also passed, the behaviour for `list -e -a` should match this. This fix modifies the search logic used when listing all package versions with `--exact` to also check for and respect the `--pre` flag from the configuration context, much like other list commands use the setting in this file in other places.
Due to a prior fix in the logic for `list -e -a`, all packages with the target ID were being returned, regardless of whether the user uses the `--pre` flag or not. Since the same search without `--exact` does not return prerelease versions unless the `--pre` option is also passed, the behaviour for `list -e -a` should match this. This fix modifies the search logic used when listing all package versions with `--exact` to also check for and respect the `--pre` flag from the configuration context, much like other list commands use the setting in this file in other places. I also did a minor refactor to avoid doing a double query here, now we only call the Search() function if we're actually going to use those results. The code paths for AllVersions completely discard that already, so this just removes the need to call the method unnecessarily.
Due to a prior fix in the logic for `list -e -a`, all packages with the target ID were being returned, regardless of whether the user uses the `--pre` flag or not. Since the same search without `--exact` does not return prerelease versions unless the `--pre` option is also passed, the behaviour for `list -e -a` should match this. This fix modifies the search logic used when listing all package versions with `--exact` to also check for and respect the `--pre` flag from the configuration context, much like other list commands use the setting in this file in other places. Also includes a minor refactor to avoid doing a double query here; now we only call the Search() function if we're actually going to use those results. The code paths for AllVersions completely discard that already, so this just removes the need to call the method unnecessarily.
Due to a prior fix in the logic for `list -e -a`, all packages with the target ID were being returned, regardless of whether the user uses the `--pre` flag or not. Since the same search without `--exact` does not return prerelease versions unless the `--pre` option is also passed, the behaviour for `list -e -a` should match this. This fix modifies the search logic used when listing all package versions with `--exact` to also check for and respect the `--pre` flag from the configuration context, much like other list commands use the setting in this file in other places. Also includes a minor refactor to avoid doing a double query here; now we only call the Search() function if we're actually going to use those results. The code paths for AllVersions completely discard that already, so this just removes the need to call the method unnecessarily.
Due to a prior fix in the logic for `list -e -a`, all packages with the target ID were being returned, regardless of whether the user uses the `--pre` flag or not. Since the same search without `--exact` does not return prerelease versions unless the `--pre` option is also passed, the behaviour for `list -e -a` should match this. This fix modifies the search logic used when listing all package versions with `--exact` to also check for and respect the `--pre` flag from the configuration context, much like other list commands use the setting in this file in other places. Also includes a minor refactor to avoid doing a double query here; now we only call the Search() function if we're actually going to use those results. The code paths for AllVersions completely discard that already, so this just removes the need to call the method unnecessarily.
choco list -e -a
returns pre-releases even when --pre
is not passedchoco list -e -a
returns pre-releases even when --pre
is not passed
I have marked this issue with |
…leases (#2304) Make list --exact --all-versions to filter out prereleases by default
From what I could tell, although there was a recent fix to make the behaviour this way, (it was briefly "broken" in that |
@vexx32 understood. Makes sense. I have removed the |
SHA-1: 74d7d39 * (chocolatey#2304) Fix list --exact -a for prereleases Due to a prior fix in the logic for `list -e -a`, all packages with the target ID were being returned, regardless of whether the user uses the `--pre` flag or not. Since the same search without `--exact` does not return prerelease versions unless the `--pre` option is also passed, the behaviour for `list -e -a` should match this. This fix modifies the search logic used when listing all package versions with `--exact` to also check for and respect the `--pre` flag from the configuration context, much like other list commands use the setting in this file in other places. Also includes a minor refactor to avoid doing a double query here; now we only call the Search() function if we're actually going to use those results. The code paths for AllVersions completely discard that already, so this just removes the need to call the method unnecessarily.
What You Are Seeing?
Output contains pre-releases
Actual output
What is Expected?
Output should not contain pre-releases when
--pre
flag isn't passedExpected output
How Did You Get This To Happen? (Steps to Reproduce)
choco upgrade chocolatey --pre
choco list -e -a python3
Output Log
Full Log Output
The text was updated successfully, but these errors were encountered: