(#508) Fix nuspec casing on non-Windows #2957
Merged
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.
Description Of Changes
The NuGet.Client libraries will install nuspec files with a lowercase filename, even if the package ID contains uppercase character(s) and the nuspec in the nupkg is also uppercase. This behavior means that on non-Windows platforms, the nuspec is not able to be found, because it has incorrect casing in the filename.
This corrects that behavior on non-Windows platforms by renaming the nuspec to the correct cased filename. On Windows, there is no need to adjust the casing, because the filesystem is case-insensitive.
The
to_lower()
calls when setting the PackageResult.Name are removed, so the output of the name of the package will match the actual casing of the name.Also, integration tests are added to ensure that packages that have IDs
with uppercase character(s) can be installed, upgraded, listed,
and uninstalled.
Motivation and Context
Not being able to install/upgrade packages with uppercase IDs would be a breaking change.
This also adds tests to ensure that #2409 is fixed.
Testing
On a Linux system run:
And ensure all operations succeed
Operating Systems Testing
Change Types Made
Change Checklist
Related Issue
Fixes #2409
Part of #508
https://app.clickup.com/t/20540031/PROJ-451