Skip to content

Commit

Permalink
(GH-584) Reinstall should use available package
Browse files Browse the repository at this point in the history
The information contained in the available package may have pertinent
information that the installed package does not have, such as whether
it is approved or not, or whether there is a cached download available.
Use the available package for performing the reinstall versus the
existing package. This also may fix other issues, like when a package
has been corrected while it is still under moderation and/or while a
maintainer is repeatedly testing a package.
  • Loading branch information
ferventcoder committed Jan 30, 2016
1 parent a9519b5 commit 3757e7d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/chocolatey/infrastructure.app/services/NugetService.cs
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ public ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfigu

if (installedPackage != null && (installedPackage.Version == availablePackage.Version) && config.Force)
{
var forcedResult = packageInstalls.GetOrAdd(packageName, new PackageResult(installedPackage, _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, installedPackage.Id)));
var forcedResult = packageInstalls.GetOrAdd(packageName, new PackageResult(availablePackage, _fileSystem.combine_paths(ApplicationParameters.PackagesLocation, availablePackage.Id)));
forcedResult.Messages.Add(new ResultMessage(ResultType.Note, "Backing up and removing old version"));

backup_existing_version(config, installedPackage, _packageInfoService.get_package_information(installedPackage));
Expand Down

0 comments on commit 3757e7d

Please sign in to comment.