diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index a503c1ee3c..d4812932b6 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -1030,12 +1030,12 @@ public ConcurrentDictionary uninstall_run(ChocolateyConfi && (installerExists || portableExists || cmdLineExists) ) { - var actualPackageName = installerExists ? - "{0}.install".format_with(packageName) - : portableExists ? - "{0}.portable".format_with(packageName) + var actualPackageName = installerExists ? + "{0}.install".format_with(packageName) + : portableExists ? + "{0}.portable".format_with(packageName) : "{0}.commandline".format_with(packageName); - + var timeoutInSeconds = config.PromptForConfirmation ? 0 : 20; this.Log().Warn(@"You are uninstalling {0}, which is likely a metapackage for an *.install/*.portable package that it installed @@ -1190,7 +1190,7 @@ public ConcurrentDictionary uninstall_run(ChocolateyConfi } } } - + return packageUninstalls; } @@ -1248,10 +1248,22 @@ public void remove_installation_files(IPackage removedPackage, ChocolateyPackage private IEnumerable get_all_intalled_packages(ChocolateyConfiguration config) { + //todo : move to deep copy for get all installed + //var listConfig = config.deep_copy(); + //listConfig.ListCommand.LocalOnly = true; + //listConfig.Noop = false; + //listConfig.PackageNames = string.Empty; + //listConfig.Input = string.Empty; + //listConfig.QuietOutput = true; + + //return list_run(listConfig).ToList(); + config.ListCommand.LocalOnly = true; var sources = config.Sources; + //changed by the command automatically when LocalOnly = true config.Sources = ApplicationParameters.PackagesLocation; var pre = config.Prerelease; + //changed by the command automatically when LocalOnly = true config.Prerelease = true; var noop = config.Noop; config.Noop = false; @@ -1279,11 +1291,11 @@ private void set_package_names_if_all_is_specified(ChocolateyConfiguration confi if (config.PackageNames.is_equal_to(ApplicationParameters.AllPackages)) { var packagesToUpdate = get_all_intalled_packages(config).Select(p => p.Name).ToList(); - + if (!string.IsNullOrWhiteSpace(config.UpgradeCommand.PackageNamesToSkip)) { var packagesToSkip = config.UpgradeCommand.PackageNamesToSkip - .Split(new [] {','}, StringSplitOptions.RemoveEmptyEntries) + .Split(new[] { ',' }, StringSplitOptions.RemoveEmptyEntries) .Where(item => !string.IsNullOrWhiteSpace(item)) .Select(p => p.trim_safe()) .ToList();