From c3154d16f4856bf0bcbcd22c047bb40efcd80a15 Mon Sep 17 00:00:00 2001 From: TheCakeIsNaOH Date: Tue, 4 Jan 2022 23:01:39 -0600 Subject: [PATCH] (#2503) Make Nuget service method public Changes the set_package_config_for_upgrade method in the nuget service to be public so it can be accessed for purposes of parsing the saved arguments so they can be exported. --- .../infrastructure.app/services/INugetService.cs | 9 +++++++++ .../infrastructure.app/services/NugetService.cs | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/chocolatey/infrastructure.app/services/INugetService.cs b/src/chocolatey/infrastructure.app/services/INugetService.cs index 22e9debea0..77083f181a 100644 --- a/src/chocolatey/infrastructure.app/services/INugetService.cs +++ b/src/chocolatey/infrastructure.app/services/INugetService.cs @@ -19,6 +19,7 @@ namespace chocolatey.infrastructure.app.services using System.Collections.Concurrent; using System.Collections.Generic; using configuration; + using domain; using results; public interface INugetService : ISourceRunner @@ -65,5 +66,13 @@ public interface INugetService : ISourceRunner /// /// The configuration IEnumerable get_all_installed_packages(ChocolateyConfiguration config); + + /// + /// Sets the configuration for the package upgrade + /// + /// The configuration. + /// The package information. + /// The original unmodified configuration, so it can be reset after upgrade + ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo); } } diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index c6d546c2fd..6c0a62476a 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -962,7 +962,7 @@ public virtual void remove_rollback_directory_if_exists(string packageName) /// The configuration. /// The package information. /// The original unmodified configuration, so it can be reset after upgrade - protected virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo) + public virtual ChocolateyConfiguration set_package_config_for_upgrade(ChocolateyConfiguration config, ChocolateyPackageInformation packageInfo) { if (!config.Features.UseRememberedArgumentsForUpgrades || string.IsNullOrWhiteSpace(packageInfo.Arguments)) return config;