Skip to content
This repository has been archived by the owner on Dec 18, 2017. It is now read-only.

Make "kpm restore" case-sensitive #627

Merged
merged 1 commit into from
Sep 12, 2014
Merged

Conversation

ChengTian
Copy link
Contributor

parent #581

Shows user-friendly warning:
Unable to locate System.console >= 4.0.0.0. Do you mean System.Console?

@@ -57,7 +58,18 @@ public IEnumerable<PackageInfo> FindPackagesById(string packageId)
continue;
}

packages.Add(new PackageInfo(_repositoryRoot, id, version, versionDir));
// Get the accurate package id to ensure case-sensitivity
var manifestFileName = Path.GetFileName(
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why are we scanning files here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As my comments suggest, we want to get accurate package name (i.e. package name in correct casing) here. This accurate name will be used to do casing check before installation of the package.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure how I feel about this since we spent a whole bunch of time making this avoid scanning in the first place. Why can't this check be done later? Or why can't restore just fix it up before the runtime sees it?

@ChengTian
Copy link
Contributor Author

@davidfowl , PackageRepository now has different behaviors in different contexts.


public PackageRepository(string path)
public PackageRepository(string path, bool isInRuntimeContext)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

rename this variable to checkPackageIdCase

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed in the latest commit.

- PackageRepository has different behaviors in different contexts
@ChengTian ChengTian force-pushed the fix-casing-behavior-of-kpm-restore branch from 648a1a5 to c5de200 Compare September 12, 2014 23:38
@ChengTian ChengTian merged commit c5de200 into dev Sep 12, 2014
@@ -137,7 +138,7 @@ public PackageInfo BuildModel(string id, XElement element)

return new PackageInfo
{
Id = id,
Id = element.Element(_xnameTitle).Value,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This broke the EF build. There is a case difference between the id and title of the redis-64 package. The NuGet URL is expecting the Id to be passed, not the title.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the id afaik

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could also be exacerbated by an issue on the NuGet server where it rewrites the id to uppercase because that's what it's been historically.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actually, I think NuGet was changing underneath us. Things seem to be ok if we use 'Redis-64' now.

@ChengTian ChengTian deleted the fix-casing-behavior-of-kpm-restore branch March 9, 2015 17:32
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants