Skip to content

Commit

Permalink
(chocolatey#23) Rename function
Browse files Browse the repository at this point in the history
This renames the SetPackageNamesIfAllSpecified function to
SetLocalPackageNamesIfAllSpecified. This is to increase clarity for when
the all keyword is implemented, and a function will be added that sets
packages names from a remote source.
  • Loading branch information
TheCakeIsNaOH authored and gep13 committed Apr 23, 2024
1 parent 2596f28 commit 9d99168
Showing 1 changed file with 4 additions and 4 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 @@ -1021,7 +1021,7 @@ public virtual ConcurrentDictionary<string, PackageResult> Upgrade(ChocolateyCon
var projectContext = new ChocolateyNuGetProjectContext(config, _nugetLogger);

var configIgnoreDependencies = config.IgnoreDependencies;
var allLocalPackages = SetPackageNamesIfAllSpecified(config, () => { config.IgnoreDependencies = true; }).ToList();
var allLocalPackages = SetLocalPackageNamesIfAllSpecified(config, () => { config.IgnoreDependencies = true; }).ToList();
config.IgnoreDependencies = configIgnoreDependencies;
var localPackageListValid = true;

Expand Down Expand Up @@ -1679,7 +1679,7 @@ public virtual ConcurrentDictionary<string, PackageResult> GetOutdated(Chocolate

var outdatedPackages = new ConcurrentDictionary<string, PackageResult>();

var allPackages = SetPackageNamesIfAllSpecified(config, () => { config.IgnoreDependencies = true; });
var allPackages = SetLocalPackageNamesIfAllSpecified(config, () => { config.IgnoreDependencies = true; });
var packageNames = config.PackageNames.Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).OrEmpty().ToList();

config.CreateBackup();
Expand Down Expand Up @@ -2271,7 +2271,7 @@ public virtual ConcurrentDictionary<string, PackageResult> Uninstall(ChocolateyC
}
}

SetPackageNamesIfAllSpecified(config, () =>
SetLocalPackageNamesIfAllSpecified(config, () =>
{
// force remove the item, ignore the dependencies
// as those are going to be picked up anyway
Expand Down Expand Up @@ -2862,7 +2862,7 @@ public IEnumerable<PackageResult> GetInstalledPackages(ChocolateyConfiguration c
return installedPackages;
}

private IEnumerable<PackageResult> SetPackageNamesIfAllSpecified(ChocolateyConfiguration config, Action customAction)
private IEnumerable<PackageResult> SetLocalPackageNamesIfAllSpecified(ChocolateyConfiguration config, Action customAction)
{
var allPackages = GetInstalledPackages(config);
if (config.PackageNames.IsEqualTo(ApplicationParameters.AllPackages))
Expand Down

0 comments on commit 9d99168

Please sign in to comment.