forked from chocolatey/choco
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
(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.
- Loading branch information
Showing
8 changed files
with
176 additions
and
7 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
18 changes: 18 additions & 0 deletions
18
src/chocolatey.tests.integration/context/exactpackage/exactpackage/0.9.0/exactpackage.nuspec
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<id>exactpackage</id> | ||
<version>0.9.0</version> | ||
<title>exactpackage</title> | ||
<authors>__REPLACE_AUTHORS_OF_SOFTWARE__</authors> | ||
<owners>__REPLACE_YOUR_NAME__</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>__REPLACE__</description> | ||
<summary>__REPLACE__</summary> | ||
<releaseNotes /> | ||
<tags>exactpackage admin</tags> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
</files> | ||
</package> |
1 change: 1 addition & 0 deletions
1
src/chocolatey.tests.integration/context/exactpackage/exactpackage/0.9.0/tools/purpose.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
when running choco list exactpackage -e --all, this package should be in the resulting list. |
18 changes: 18 additions & 0 deletions
18
...latey.tests.integration/context/exactpackage/exactpackage/1.0.0-beta1/exactpackage.nuspec
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
<?xml version="1.0"?> | ||
<package xmlns="http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"> | ||
<metadata> | ||
<id>exactpackage</id> | ||
<version>1.0.0-beta1</version> | ||
<title>exactpackage</title> | ||
<authors>__REPLACE_AUTHORS_OF_SOFTWARE__</authors> | ||
<owners>__REPLACE_YOUR_NAME__</owners> | ||
<requireLicenseAcceptance>false</requireLicenseAcceptance> | ||
<description>__REPLACE__</description> | ||
<summary>__REPLACE__</summary> | ||
<releaseNotes /> | ||
<tags>exactpackage admin</tags> | ||
</metadata> | ||
<files> | ||
<file src="tools\**" target="tools" /> | ||
</files> | ||
</package> |
1 change: 1 addition & 0 deletions
1
...colatey.tests.integration/context/exactpackage/exactpackage/1.0.0-beta1/tools/purpose.txt
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
When running choco list exactpackage -a --all --pre, this package should be in the returned results. |
This file contains 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
This file contains 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