Skip to content

Commit

Permalink
remove tolowers for package result name
Browse files Browse the repository at this point in the history
  • Loading branch information
TheCakeIsNaOH committed Jan 5, 2023
1 parent 988f1b9 commit 009f236
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1933,7 +1933,7 @@ public virtual ConcurrentDictionary<string, PackageResult> uninstall_run(Chocola
remove_rollback_directory_if_exists(packageName);
backup_existing_version(config, packageToUninstall.PackageMetadata, uninstallPkgInfo);

var packageResult = packageResultsToReturn.GetOrAdd(packageToUninstall.Name.to_lower() + "." + packageToUninstall.Version.to_string(), packageToUninstall);
var packageResult = packageResultsToReturn.GetOrAdd(packageToUninstall.Name + "." + packageToUninstall.Version.to_string(), packageToUninstall);
packageResult.InstallLocation = packageToUninstall.InstallLocation;
string logMessage = "{0}{1} v{2}{3}".format_with(Environment.NewLine, packageToUninstall.Name, packageToUninstall.Version.to_string(), config.Force ? " (forced)" : string.Empty);
packageResult.Messages.Add(new ResultMessage(ResultType.Debug, ApplicationParameters.Messages.ContinueChocolateyAction));
Expand Down Expand Up @@ -1968,12 +1968,12 @@ public virtual ConcurrentDictionary<string, PackageResult> uninstall_run(Chocola
{
var logMessage = "{0} not uninstalled. An error occurred during uninstall:{1} {2}".format_with(packageName, Environment.NewLine, ex.Message);
this.Log().Error(ChocolateyLoggers.Important, logMessage);
var result = packageResultsToReturn.GetOrAdd(packageToUninstall.Name.to_lower() + "." + packageToUninstall.Version.to_string(), new PackageResult(packageToUninstall.PackageMetadata, pathResolver.GetInstallPath(packageToUninstall.PackageMetadata.Id, packageToUninstall.PackageMetadata.Version)));
var result = packageResultsToReturn.GetOrAdd(packageToUninstall.Name + "." + packageToUninstall.Version.to_string(), new PackageResult(packageToUninstall.PackageMetadata, pathResolver.GetInstallPath(packageToUninstall.PackageMetadata.Id, packageToUninstall.PackageMetadata.Version)));
result.Messages.Add(new ResultMessage(ResultType.Error, logMessage));
if (result.ExitCode == 0) result.ExitCode = 1;
if (config.Features.StopOnFirstPackageFailure)
{
throw new ApplicationException("Stopping further execution as {0} has failed uninstallation".format_with(packageToUninstall.Name.to_lower()));
throw new ApplicationException("Stopping further execution as {0} has failed uninstallation".format_with(packageToUninstall.Name));
}
// do not call continueAction - will result in multiple passes
}
Expand All @@ -1982,7 +1982,7 @@ public virtual ConcurrentDictionary<string, PackageResult> uninstall_run(Chocola
else
{
// continue action won't be found b/c we are not actually uninstalling (this is noop)
var result = packageResultsToReturn.GetOrAdd(installedPackage.Name.to_lower() + "." + installedPackage.Version.to_string(), new PackageResult(installedPackage.PackageMetadata, pathResolver.GetInstallPath(installedPackage.PackageMetadata.Id, installedPackage.PackageMetadata.Version)));
var result = packageResultsToReturn.GetOrAdd(installedPackage.Name + "." + installedPackage.Version.to_string(), new PackageResult(installedPackage.PackageMetadata, pathResolver.GetInstallPath(installedPackage.PackageMetadata.Id, installedPackage.PackageMetadata.Version)));
if (continueAction != null) continueAction.Invoke(result, config);
}
}
Expand Down
8 changes: 4 additions & 4 deletions src/chocolatey/infrastructure/results/PackageResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ public void ResetMetadata(IPackageMetadata metadata, IPackageSearchMetadata sear
{
PackageMetadata = metadata;
SearchMetadata = search;
Name = metadata.Id.to_lower();
Name = metadata.Id;
Version = metadata.Version.to_string();
}

public PackageResult(IPackageMetadata packageMetadata, string installLocation, string source = null) : this(packageMetadata.Id.to_lower(), packageMetadata.Version.to_string(), installLocation)
public PackageResult(IPackageMetadata packageMetadata, string installLocation, string source = null) : this(packageMetadata.Id, packageMetadata.Version.to_string(), installLocation)
{
PackageMetadata = packageMetadata;
Source = source;
}

public PackageResult(IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageSearch.Identity.Id.to_lower(), packageSearch.Identity.Version.to_string(), installLocation)
public PackageResult(IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageSearch.Identity.Id, packageSearch.Identity.Version.to_string(), installLocation)
{
SearchMetadata = packageSearch;
Source = source;
Expand Down Expand Up @@ -103,7 +103,7 @@ public PackageResult(IPackageSearchMetadata packageSearch, string installLocatio
*/
}

public PackageResult(IPackageMetadata packageMetadata, IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageMetadata.Id.to_lower(), packageMetadata.Version.to_string(), installLocation)
public PackageResult(IPackageMetadata packageMetadata, IPackageSearchMetadata packageSearch, string installLocation, string source = null) : this(packageMetadata.Id, packageMetadata.Version.to_string(), installLocation)
{
SearchMetadata = packageSearch;
PackageMetadata = packageMetadata;
Expand Down

0 comments on commit 009f236

Please sign in to comment.