From 92b5296033afb2d944de6440d69f9fdfb3d652e4 Mon Sep 17 00:00:00 2001 From: Gary Ewan Park Date: Wed, 4 Mar 2015 13:32:19 +0000 Subject: [PATCH 1/3] (maint) Correcting typos - Thanks to the ReSpeller Extension for Resharper --- src/chocolatey.console/Program.cs | 4 +-- src/chocolatey.sln.DotSettings | 1 + src/chocolatey.tests.integration/Scenario.cs | 2 +- .../scenarios/InstallScenarios.cs | 2 +- src/chocolatey.tests/GetChocolateySpecs.cs | 8 ++--- .../information/VersionInformationSpecs.cs | 2 +- src/chocolatey/EnumerableExtensions.cs | 2 +- .../builders/ConfigurationBuilder.cs | 4 +-- .../commands/ChocolateyApiKeyCommand.cs | 2 +- .../commands/ChocolateyListCommand.cs | 2 +- .../commands/ChocolateyUpgradeCommand.cs | 2 +- .../configuration/ChocolateyConfiguration.cs | 4 +-- .../runners/GenericRunner.cs | 2 +- .../services/ChocolateyPackageService.cs | 4 +-- .../services/INugetService.cs | 2 +- .../services/NugetService.cs | 34 +++++++++---------- .../services/PowershellService.cs | 2 +- .../services/TemplateService.cs | 8 ++--- src/chocolatey/infrastructure/logging/Log.cs | 2 +- .../logging/Log4NetAppenderConfiguration.cs | 2 +- .../tolerance/FaultTolerance.cs | 4 +-- 21 files changed, 48 insertions(+), 47 deletions(-) diff --git a/src/chocolatey.console/Program.cs b/src/chocolatey.console/Program.cs index 356b4f13dc..67f50cc3f1 100644 --- a/src/chocolatey.console/Program.cs +++ b/src/chocolatey.console/Program.cs @@ -72,7 +72,7 @@ private static void Main(string[] args) trap_exit_scenarios(config); - if (config.RegularOuptut) + if (config.RegularOutput) { "logfile".Log().Info(() => "".PadRight(60, '=')); #if DEBUG @@ -83,7 +83,7 @@ private static void Main(string[] args) } - if (warnings.Count != 0 && config.RegularOuptut) + if (warnings.Count != 0 && config.RegularOutput) { foreach (var warning in warnings.or_empty_list_if_null()) { diff --git a/src/chocolatey.sln.DotSettings b/src/chocolatey.sln.DotSettings index 8ecdc5ff46..a20746b238 100644 --- a/src/chocolatey.sln.DotSettings +++ b/src/chocolatey.sln.DotSettings @@ -34,4 +34,5 @@ limitations under the License. <Policy><Descriptor Staticness="Static, Instance" AccessRightKinds="Public" Description="Properties"><ElementKinds><Kind Name="PROPERTY" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="AaBb" /></Policy> <Policy><Descriptor Staticness="Static, Instance" AccessRightKinds="Private, Protected, ProtectedInternal, Internal, Public" Description="Methods, Events"><ElementKinds><Kind Name="METHOD" /><Kind Name="EVENT" /></ElementKinds></Descriptor><Policy Inspect="True" Prefix="" Suffix="" Style="aa_bb" /></Policy> SOLUTION_FOLDER + True \ No newline at end of file diff --git a/src/chocolatey.tests.integration/Scenario.cs b/src/chocolatey.tests.integration/Scenario.cs index d97fde1337..9147f0fe07 100644 --- a/src/chocolatey.tests.integration/Scenario.cs +++ b/src/chocolatey.tests.integration/Scenario.cs @@ -108,7 +108,7 @@ private static ChocolateyConfiguration baseline_configuration() config.OverrideArguments = false; config.Prerelease = false; config.PromptForConfirmation = false; - config.RegularOuptut = true; + config.RegularOutput = true; config.SkipPackageInstallProvider = false; config.Sources = _fileSystem.get_full_path(_fileSystem.combine_paths(get_top_level(), "packages")); config.Version = null; diff --git a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs index 9bfcba646d..3048452920 100644 --- a/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs +++ b/src/chocolatey.tests.integration/scenarios/InstallScenarios.cs @@ -213,7 +213,7 @@ public void should_not_create_a_shim_for_mismatched_case_ignored_executable_in_t } [Fact] - public void should_not_create_an_extensions_folder_for_the_pacakge() + public void should_not_create_an_extensions_folder_for_the_package() { var extensionsDirectory = Path.Combine(Scenario.get_top_level(), "extensions", Configuration.PackageNames); diff --git a/src/chocolatey.tests/GetChocolateySpecs.cs b/src/chocolatey.tests/GetChocolateySpecs.cs index 973e8bab8f..20fd5d6ec9 100644 --- a/src/chocolatey.tests/GetChocolateySpecs.cs +++ b/src/chocolatey.tests/GetChocolateySpecs.cs @@ -37,13 +37,13 @@ public override void Because() } [Fact] - public void should_get_chocolotey() + public void should_get_chocolatey() { _chocolatey.ShouldNotBeNull(); } [Fact] - public void should_conigure_log4net() + public void should_configure_log4net() { LogManager.GetRepository().Configured.ShouldBeTrue(); } @@ -61,13 +61,13 @@ public override void Because() } [Fact] - public void should_get_instantiated_chocolotey1() + public void should_get_instantiated_chocolatey1() { _chocolatey1.ShouldNotBeNull(); } [Fact] - public void should_get_instantiated_chocolotey2() + public void should_get_instantiated_chocolatey2() { _chocolatey2.ShouldNotBeNull(); } diff --git a/src/chocolatey.tests/infrastructure/information/VersionInformationSpecs.cs b/src/chocolatey.tests/infrastructure/information/VersionInformationSpecs.cs index 414c4fed03..9dfb905fc0 100644 --- a/src/chocolatey.tests/infrastructure/information/VersionInformationSpecs.cs +++ b/src/chocolatey.tests/infrastructure/information/VersionInformationSpecs.cs @@ -50,7 +50,7 @@ public void should_not_be_empty() } [Fact] - public void should_be_transferrable_to_Version() + public void should_be_transferable_to_Version() { new Version(result).ShouldNotBeNull(); } diff --git a/src/chocolatey/EnumerableExtensions.cs b/src/chocolatey/EnumerableExtensions.cs index 27f2cc4279..8c000c7309 100644 --- a/src/chocolatey/EnumerableExtensions.cs +++ b/src/chocolatey/EnumerableExtensions.cs @@ -48,7 +48,7 @@ public static IEnumerable or_empty_list_if_null(this IEnumerable source) } /// - /// Joins the specified IEnumerables. + /// Joins the specified IEnumerable to required separator. /// /// The source. /// The value to put in between elements diff --git a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs index 5ab18a2bfc..0885f491ac 100644 --- a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs +++ b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs @@ -175,8 +175,8 @@ private static void set_global_options(IList args, ChocolateyConfigurati "NoOp - Don't actually do anything.", option => config.Noop = option != null) .Add("r|limitoutput|limit-output", - "LimitOuptut - Limit the output to essential information", - option => config.RegularOuptut = option == null) + "LimitOutput - Limit the output to essential information", + option => config.RegularOutput = option == null) .Add("execution-timeout=", "CommandExecutionTimeoutSeconds - Override the default execution timeout in the configuration of {0} seconds.".format_with(config.CommandExecutionTimeoutSeconds.to_string()), option => config.CommandExecutionTimeoutSeconds = int.Parse(option)) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs index c91808eb9d..e8f3b6670d 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs @@ -112,7 +112,7 @@ public void run(ChocolateyConfiguration configuration) { _configSettingsService.get_api_key(configuration, (key) => { - if (configuration.RegularOuptut) + if (configuration.RegularOutput) { this.Log().Info(() => "{0} - {1}".format_with(key.Source, key.Key)); } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs index 75ba0471aa..472ba448f5 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs @@ -48,7 +48,7 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati "Prerelease - Include Prereleases? Defaults to false.", option => configuration.Prerelease = option != null) .Add("p|includeprograms|include-programs", - "IncludePrograms - Used in conjuction with LocalOnly, filters out apps chocolatey has listed as packages and includes those in the list. Defaults to false.", + "IncludePrograms - Used in conjunction with LocalOnly, filters out apps chocolatey has listed as packages and includes those in the list. Defaults to false.", option => configuration.ListCommand.IncludeRegistryPrograms = option != null) .Add("a|all|allversions|all-versions", "AllVersions - include results from all versions.", diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs index ea30d8dcfa..a040d2c260 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs @@ -74,7 +74,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon "Skip Powershell - Do not run chocolateyInstall.ps1. Defaults to false.", option => configuration.SkipPackageInstallProvider = option != null) .Add("failonunfound|fail-on-unfound", - "Fail On Unfound Packages - If a pacakge is not found in feeds specified, fail instead of warn.", + "Fail On Unfound Packages - If a package is not found in feeds specified, fail instead of warn.", option => configuration.UpgradeCommand.FailOnUnfound = option != null) ; } diff --git a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs index 64d52807d8..f8a163b778 100644 --- a/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs +++ b/src/chocolatey/infrastructure.app/configuration/ChocolateyConfiguration.cs @@ -31,7 +31,7 @@ public class ChocolateyConfiguration { public ChocolateyConfiguration() { - RegularOuptut = true; + RegularOutput = true; PromptForConfirmation = true; Information = new InformationCommandConfiguration(); Features = new FeaturesConfiguration(); @@ -150,7 +150,7 @@ private void append_output(StringBuilder propertyValues, string append) public bool Force { get; set; } public bool Noop { get; set; } public bool HelpRequested { get; set; } - public bool RegularOuptut { get; set; } + public bool RegularOutput { get; set; } public bool PromptForConfirmation { get; set; } public bool AcceptLicense { get; set; } public bool AllowUnofficialBuild { get; set; } diff --git a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs index 99b14f1ace..a30499d330 100644 --- a/src/chocolatey/infrastructure.app/runners/GenericRunner.cs +++ b/src/chocolatey/infrastructure.app/runners/GenericRunner.cs @@ -90,7 +90,7 @@ now be in a bad state. Only official builds are to be trusted. if (config.Noop) { - if (config.RegularOuptut) + if (config.RegularOutput) { this.Log().Info("_ {0}:{1} - Noop Mode _".format_with(ApplicationParameters.Name, command.GetType().Name)); } diff --git a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs index baed18d2e1..d7802d03b1 100644 --- a/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs +++ b/src/chocolatey/infrastructure.app/services/ChocolateyPackageService.cs @@ -78,7 +78,7 @@ public void list_run(ChocolateyConfiguration config, bool logResults) else { var list = _nugetService.list_run(config, logResults: true); - if (config.RegularOuptut) + if (config.RegularOutput) { this.Log().Warn(() => @"{0} packages {1}.".format_with(list.Count, config.ListCommand.LocalOnly ? "installed" : "found")); @@ -330,7 +330,7 @@ private IEnumerable get_packages_from_config(string pac public void upgrade_noop(ChocolateyConfiguration config) { var noopUpgrades = _nugetService.upgrade_noop(config, (pkg) => _powershellService.install_noop(pkg)); - if (config.RegularOuptut) + if (config.RegularOutput) { var upgradeWarnings = noopUpgrades.Count(p => p.Value.Warning); this.Log().Warn(() => @"{0}{1} can upgrade {2}/{3} package(s). {4}{0} See the log for details.".format_with( diff --git a/src/chocolatey/infrastructure.app/services/INugetService.cs b/src/chocolatey/infrastructure.app/services/INugetService.cs index 5035dc1307..63d8ac92bb 100644 --- a/src/chocolatey/infrastructure.app/services/INugetService.cs +++ b/src/chocolatey/infrastructure.app/services/INugetService.cs @@ -29,7 +29,7 @@ public interface INugetService void list_noop(ChocolateyConfiguration config); /// - /// Lists/searches for pacakge against nuget related feeds. + /// Lists/searches for package against nuget related feeds. /// /// The configuration. /// Should results be logged? diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index 5b817d7c0d..bfab25becb 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -81,7 +81,7 @@ public ConcurrentDictionary list_run(ChocolateyConfigurat { if (logResults) { - if (config.RegularOuptut) + if (config.RegularOutput) { this.Log().Info(config.Verbose ? ChocolateyLoggers.Important : ChocolateyLoggers.Normal, () => "{0} {1}".format_with(package.Id, package.Version.to_string())); if (config.Verbose) this.Log().Info(() => " {0}{1} Description: {2}{1} Tags: {3}{1} Number of Downloads: {4}{1}".format_with(package.Title.escape_curly_braces(), Environment.NewLine, package.Description.escape_curly_braces(), package.Tags.escape_curly_braces(), package.DownloadCount <= 0 ? "n/a" : package.DownloadCount.to_string())); @@ -183,11 +183,11 @@ public void push_noop(ChocolateyConfiguration config) public void push_run(ChocolateyConfiguration config) { string nupkgFilePath = validate_and_return_package_file(config, Constants.PackageExtension); - if (config.RegularOuptut) this.Log().Info(() => "Attempting to push {0} to {1}".format_with(_fileSystem.get_file_name(nupkgFilePath), config.Sources)); + if (config.RegularOutput) this.Log().Info(() => "Attempting to push {0} to {1}".format_with(_fileSystem.get_file_name(nupkgFilePath), config.Sources)); NugetPush.push_package(config, _fileSystem.get_full_path(nupkgFilePath)); - if (config.RegularOuptut) this.Log().Warn(ChocolateyLoggers.Important, () => @" + if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, () => @" Your package may be subject to moderation. A moderator will review the package prior to acceptance. You should have received an email. If you @@ -253,7 +253,7 @@ public ConcurrentDictionary install_run(ChocolateyConfigu } // this is when someone points the source directly at a nupkg - // e.g. -s c:\somelocation\somwere\packagename.nupkg + // e.g. -s c:\somelocation\somewhere\packagename.nupkg if (config.Sources.to_string().EndsWith(Constants.PackageExtension)) { config.Sources = _fileSystem.get_directory_name(_fileSystem.get_full_path(config.Sources)); @@ -425,7 +425,7 @@ public ConcurrentDictionary upgrade_run(ChocolateyConfigu //var results = packageInstalls.GetOrAdd(packageName, new PackageResult(packageName, null, null)); //results.Messages.Add(new ResultMessage(ResultType.Error, logMessage)); - //if (config.RegularOuptut) this.Log().Error(ChocolateyLoggers.Important, logMessage); + //if (config.RegularOutput) this.Log().Error(ChocolateyLoggers.Important, logMessage); //continue; string logMessage = @" @@ -435,7 +435,7 @@ packages as of version 1.0.0. That is what the install command is for. {0} is not installed. Installing...".format_with(packageName); - if (config.RegularOuptut) this.Log().Warn(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, logMessage); var packageNames = config.PackageNames; config.PackageNames = packageName; @@ -463,7 +463,7 @@ packages as of version 1.0.0. That is what the install command is for. var pinnedResults = packageInstalls.GetOrAdd(packageName, new PackageResult(packageName, null, null)); pinnedResults.Messages.Add(new ResultMessage(ResultType.Warn, logMessage)); pinnedResults.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); - if (config.RegularOuptut) this.Log().Warn(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, logMessage); continue; } @@ -476,13 +476,13 @@ packages as of version 1.0.0. That is what the install command is for. if (config.UpgradeCommand.FailOnUnfound) { unfoundResults.Messages.Add(new ResultMessage(ResultType.Error, logMessage)); - if (config.RegularOuptut) this.Log().Error(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) this.Log().Error(ChocolateyLoggers.Important, logMessage); } else { unfoundResults.Messages.Add(new ResultMessage(ResultType.Warn, logMessage)); unfoundResults.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); - if (config.RegularOuptut) this.Log().Warn(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, logMessage); } continue; @@ -500,7 +500,7 @@ packages as of version 1.0.0. That is what the install command is for. string logMessage = "{0} v{1} is newer than the most recent.{2} You must be smarter than the average bear...".format_with(installedPackage.Id, installedPackage.Version, Environment.NewLine); results.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); - if (config.RegularOuptut) this.Log().Info(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) this.Log().Info(ChocolateyLoggers.Important, logMessage); continue; } @@ -515,12 +515,12 @@ packages as of version 1.0.0. That is what the install command is for. results.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); } - if (config.RegularOuptut) this.Log().Info(logMessage); + if (config.RegularOutput) this.Log().Info(logMessage); continue; } results.Messages.Add(new ResultMessage(ResultType.Note, logMessage)); - if (config.RegularOuptut) this.Log().Info(logMessage); + if (config.RegularOutput) this.Log().Info(logMessage); } if ((availablePackage.Version > installedPackage.Version) || config.Force) @@ -530,7 +530,7 @@ packages as of version 1.0.0. That is what the install command is for. string logMessage = "You have {0} v{1} installed. Version {2} is available based on your source(s)".format_with(installedPackage.Id, installedPackage.Version, availablePackage.Version); results.Messages.Add(new ResultMessage(ResultType.Note, logMessage)); - if (config.RegularOuptut) + if (config.RegularOutput) { this.Log().Warn(logMessage); } @@ -766,7 +766,7 @@ public ConcurrentDictionary uninstall_run(ChocolateyConfi var results = packageUninstalls.GetOrAdd(packageName, new PackageResult(packageName, null, null)); results.Messages.Add(new ResultMessage(ResultType.Error, logMessage)); - if (config.RegularOuptut) this.Log().Error(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) this.Log().Error(ChocolateyLoggers.Important, logMessage); continue; } @@ -798,13 +798,13 @@ public ConcurrentDictionary uninstall_run(ChocolateyConfi if (selection.is_equal_to(allVersionsChoice)) { packageVersionsToRemove = installedPackageVersions.ToList(); - if (config.RegularOuptut) this.Log().Info(() => "You selected to remove all versions of {0}".format_with(packageName)); + if (config.RegularOutput) this.Log().Info(() => "You selected to remove all versions of {0}".format_with(packageName)); } else { IPackage pkg = installedPackageVersions.FirstOrDefault((p) => p.Version.to_string().is_equal_to(selection)); packageVersionsToRemove.Add(pkg); - if (config.RegularOuptut) this.Log().Info(() => "You selected {0} v{1}".format_with(pkg.Id, pkg.Version.to_string())); + if (config.RegularOutput) this.Log().Info(() => "You selected {0} v{1}".format_with(pkg.Id, pkg.Version.to_string())); } } } @@ -818,7 +818,7 @@ public ConcurrentDictionary uninstall_run(ChocolateyConfi var pinnedResults = packageUninstalls.GetOrAdd(packageName, new PackageResult(packageName, null, null)); pinnedResults.Messages.Add(new ResultMessage(ResultType.Warn, logMessage)); pinnedResults.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); - if (config.RegularOuptut) this.Log().Warn(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, logMessage); continue; } diff --git a/src/chocolatey/infrastructure.app/services/PowershellService.cs b/src/chocolatey/infrastructure.app/services/PowershellService.cs index 3ba74fb63a..2ebedcf37f 100644 --- a/src/chocolatey/infrastructure.app/services/PowershellService.cs +++ b/src/chocolatey/infrastructure.app/services/PowershellService.cs @@ -205,7 +205,7 @@ public bool run_action(ChocolateyConfiguration configuration, PackageResult pack var selection = InteractivePrompt .prompt_for_confirmation(@" Do you want to run the script? - NOTE: If you chooose not to run the script, the installation will + NOTE: If you choose not to run the script, the installation will fail. Skip is an advanced option and most likely will never be wanted. " diff --git a/src/chocolatey/infrastructure.app/services/TemplateService.cs b/src/chocolatey/infrastructure.app/services/TemplateService.cs index eb235d1912..172fe3c038 100644 --- a/src/chocolatey/infrastructure.app/services/TemplateService.cs +++ b/src/chocolatey/infrastructure.app/services/TemplateService.cs @@ -47,14 +47,14 @@ public void generate(ChocolateyConfiguration configuration) throw new ApplicationException("The location for the template already exists. You can:{0} 1. Remove '{1}'{0} 2. Use --force{0} 3. Specify a different name".format_with(Environment.NewLine, packageLocation)); } - if (configuration.RegularOuptut) this.Log().Info(() => "Creating a new package specification at {0}".format_with(packageLocation)); + if (configuration.RegularOutput) this.Log().Info(() => "Creating a new package specification at {0}".format_with(packageLocation)); try { _fileSystem.delete_directory_if_exists(packageLocation, recursive: true); } catch (Exception ex) { - if (configuration.RegularOuptut) this.Log().Warn(() => "{0}".format_with(ex.Message)); + if (configuration.RegularOutput) this.Log().Warn(() => "{0}".format_with(ex.Message)); } _fileSystem.create_directory_if_not_exists(packageLocation); var packageToolsLocation = _fileSystem.combine_paths(packageLocation, "tools"); @@ -76,7 +76,7 @@ public void generate(ChocolateyConfiguration configuration) } catch (Exception) { - if (configuration.RegularOuptut) this.Log().Warn("Property {0} was not found for replacement in the Template Values.".format_with(property.Key)); + if (configuration.RegularOutput) this.Log().Warn("Property {0} was not found for replacement in the Template Values.".format_with(property.Key)); } } @@ -97,7 +97,7 @@ public void generate_file_from_template(ChocolateyConfiguration configuration, T { template = TokenReplacer.replace_tokens(tokens, template); - if (configuration.RegularOuptut) this.Log().Info(() => "Generating template to a file{0} at '{1}'".format_with(Environment.NewLine, fileLocation)); + if (configuration.RegularOutput) this.Log().Info(() => "Generating template to a file{0} at '{1}'".format_with(Environment.NewLine, fileLocation)); this.Log().Debug(() => "{0}".format_with(template)); _fileSystem.write_file(fileLocation, template, encoding); } diff --git a/src/chocolatey/infrastructure/logging/Log.cs b/src/chocolatey/infrastructure/logging/Log.cs index 297477c1f4..72804f0621 100644 --- a/src/chocolatey/infrastructure/logging/Log.cs +++ b/src/chocolatey/infrastructure/logging/Log.cs @@ -52,7 +52,7 @@ public static void InitializeWith(ILog loggerType) /// This should be done only once per object name. /// /// Name of the object. - /// ILog instance for an object if log type has been intialized; otherwise null + /// ILog instance for an object if log type has been initialized; otherwise null public static ILog GetLoggerFor(string objectName) { ILog logger = _logger; diff --git a/src/chocolatey/infrastructure/logging/Log4NetAppenderConfiguration.cs b/src/chocolatey/infrastructure/logging/Log4NetAppenderConfiguration.cs index 9571401815..a4c5e40040 100644 --- a/src/chocolatey/infrastructure/logging/Log4NetAppenderConfiguration.cs +++ b/src/chocolatey/infrastructure/logging/Log4NetAppenderConfiguration.cs @@ -34,7 +34,7 @@ public sealed class Log4NetAppenderConfiguration private static bool _alreadyConfiguredFileAppender; /// - /// Pulls xmlconfiguration from embedded location and applies it. + /// Pulls xml configuration from embedded location and applies it. /// Then it configures a file appender to the specified output directory if one is provided. /// /// The output directory. diff --git a/src/chocolatey/infrastructure/tolerance/FaultTolerance.cs b/src/chocolatey/infrastructure/tolerance/FaultTolerance.cs index 68aae0b266..0854be3d63 100644 --- a/src/chocolatey/infrastructure/tolerance/FaultTolerance.cs +++ b/src/chocolatey/infrastructure/tolerance/FaultTolerance.cs @@ -40,7 +40,7 @@ private static bool log_is_in_debug_mode() } /// - /// Tries an action the specified number of tries, warning on each failure and erroring on the last. + /// Tries an action the specified number of tries, warning on each failure and raises error on the last attempt. /// /// The number of tries. /// The action. @@ -62,7 +62,7 @@ public static void retry(int numberOfTries, Action action, int waitDurationMilli } /// - /// Tries a function the specified number of tries, warning on each failure and erroring on the last. + /// Tries a function the specified number of tries, warning on each failure and raises error on the last attempt. /// /// The type of the return value from the function. /// The number of tries. From 8c3f1688da1b92044cfacab63b9101a00c79b623 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Fri, 6 Mar 2015 17:39:07 -0600 Subject: [PATCH 2/3] (GH-141) Handle option w/surrounding apostrophes When command has an option passed in with surrounding apostrophes, e.g. `--some-param='some value'`, remove the apostrophes from the value. --- .../infrastructure.app/builders/ConfigurationBuilder.cs | 4 ++-- .../commands/ChocolateyApiKeyCommand.cs | 4 ++-- .../commands/ChocolateyFeatureCommand.cs | 2 +- .../commands/ChocolateyInstallCommand.cs | 8 ++++---- .../infrastructure.app/commands/ChocolateyListCommand.cs | 2 +- .../infrastructure.app/commands/ChocolateyNewCommand.cs | 8 ++++---- .../infrastructure.app/commands/ChocolateyPackCommand.cs | 2 +- .../infrastructure.app/commands/ChocolateyPinCommand.cs | 4 ++-- .../infrastructure.app/commands/ChocolateyPushCommand.cs | 4 ++-- .../commands/ChocolateySourceCommand.cs | 8 ++++---- .../commands/ChocolateyUninstallCommand.cs | 6 +++--- .../commands/ChocolateyUpdateCommand.cs | 4 ++-- .../commands/ChocolateyUpgradeCommand.cs | 8 ++++---- .../commands/ChocolateyVersionCommand.cs | 2 +- 14 files changed, 33 insertions(+), 33 deletions(-) diff --git a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs index 0885f491ac..aea4d41cae 100644 --- a/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs +++ b/src/chocolatey/infrastructure.app/builders/ConfigurationBuilder.cs @@ -179,10 +179,10 @@ private static void set_global_options(IList args, ChocolateyConfigurati option => config.RegularOutput = option == null) .Add("execution-timeout=", "CommandExecutionTimeoutSeconds - Override the default execution timeout in the configuration of {0} seconds.".format_with(config.CommandExecutionTimeoutSeconds.to_string()), - option => config.CommandExecutionTimeoutSeconds = int.Parse(option)) + option => config.CommandExecutionTimeoutSeconds = int.Parse(option.remove_surrounding_quotes())) .Add("c=|cache=|cachelocation=|cache-location=", "CacheLocation - Location for download cache, defaults to %TEMP% or value in chocolatey.config file.", - option => config.CacheLocation = option) + option => config.CacheLocation = option.remove_surrounding_quotes()) .Add("allowunofficial|allow-unofficial|allowunofficialbuild|allow-unofficial-build", "AllowUnofficialBuild - When not using the official build you must set this flag for choco to continue.", option => config.AllowUnofficialBuild = option != null) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs index e8f3b6670d..9264bf96c0 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyApiKeyCommand.cs @@ -43,10 +43,10 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("s=|source=", "Source [REQUIRED] - The source location for the key", - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("k=|key=|apikey=|api-key=", "ApiKey - The api key for the source.", - option => configuration.ApiKeyCommand.Key = option) + option => configuration.ApiKeyCommand.Key = option.remove_surrounding_quotes()) ; } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyFeatureCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyFeatureCommand.cs index 172660caf9..3353fb84af 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyFeatureCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyFeatureCommand.cs @@ -44,7 +44,7 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("n=|name=", "Name - the name of the source. Required with some actions. Defaults to empty.", - option => configuration.FeatureCommand.Name = option) + option => configuration.FeatureCommand.Name = option.remove_surrounding_quotes()) ; } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs index ff1213d197..c2b8af1969 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyInstallCommand.cs @@ -40,10 +40,10 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("s=|source=", "Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to default feeds.", - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("version=", "Version - A specific version to install. Defaults to unspecified.", - option => configuration.Version = option) + option => configuration.Version = option.remove_surrounding_quotes()) .Add("pre|prerelease", "Prerelease - Include Prereleases? Defaults to false.", option => configuration.Prerelease = option != null) @@ -52,7 +52,7 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati option => configuration.ForceX86 = option != null) .Add("ia=|installargs=|installarguments=|install-arguments=", "InstallArguments - Install Arguments to pass to the native installer in the package. Defaults to unspecified.", - option => configuration.InstallArguments = option) + option => configuration.InstallArguments = option.remove_surrounding_quotes()) .Add("o|override|overrideargs|overridearguments|override-arguments", "OverrideArguments - Should install arguments be used exclusively without appending to current package passed arguments? Defaults to false.", option => configuration.OverrideArguments = option != null) @@ -61,7 +61,7 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati option => configuration.NotSilent = option != null) .Add("params=|parameters=|pkgparameters=|packageparameters=|package-parameters=", "PackageParameters - Parameters to pass to the package. Defaults to unspecified.", - option => configuration.PackageParameters = option) + option => configuration.PackageParameters = option.remove_surrounding_quotes()) .Add("m|sxs|sidebyside|side-by-side|allowmultiple|allow-multiple|allowmultipleversions|allow-multiple-versions", "AllowMultipleVersions - Should multiple versions of a package be installed? Defaults to false.", option => configuration.AllowMultipleVersions = option != null) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs index 472ba448f5..cd5b0af76b 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyListCommand.cs @@ -40,7 +40,7 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("s=|source=", "Source - Source location for install. Can include special 'webpi'. Defaults to sources.", - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("l|lo|localonly|local-only", "LocalOnly - Only search against local machine items.", option => configuration.ListCommand.LocalOnly = option != null) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs index e4d96acd8d..fa9bd065ab 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyNewCommand.cs @@ -47,15 +47,15 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati "Name [Required]- the name of the package. Can be passed as first parameter without \"--name=\".", option => { - configuration.NewCommand.Name = option; - configuration.NewCommand.TemplateProperties.Add(TemplateValues.NamePropertyName, option); + configuration.NewCommand.Name = option.remove_surrounding_quotes(); + configuration.NewCommand.TemplateProperties.Add(TemplateValues.NamePropertyName, option.remove_surrounding_quotes()); }) .Add("version=", "Version - the version of the package. Can also be passed as the property PackageVersion=somevalue", - option => configuration.NewCommand.TemplateProperties.Add(TemplateValues.VersionPropertyName, option)) + option => configuration.NewCommand.TemplateProperties.Add(TemplateValues.VersionPropertyName, option.remove_surrounding_quotes())) .Add("maintainer=", "Maintainer - the name of the maintainer. Can also be passed as the property MaintainerName=somevalue", - option => configuration.NewCommand.TemplateProperties.Add(TemplateValues.MaintainerPropertyName, option)) + option => configuration.NewCommand.TemplateProperties.Add(TemplateValues.MaintainerPropertyName, option.remove_surrounding_quotes())) ; //todo: template type } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyPackCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyPackCommand.cs index 4aad2d0885..4e04db7e97 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyPackCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyPackCommand.cs @@ -39,7 +39,7 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("version=", "Version - The version you would like to insert into the package.", - option => configuration.Version = option) + option => configuration.Version = option.remove_surrounding_quotes()) ; } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyPinCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyPinCommand.cs index 8dadbc6bce..4c30d38998 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyPinCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyPinCommand.cs @@ -47,10 +47,10 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("n=|name=", "Name - the name of the package. Required with some actions. Defaults to empty.", - option => configuration.PinCommand.Name = option) + option => configuration.PinCommand.Name = option.remove_surrounding_quotes()) .Add("version=", "Version - Used when multiple versions of a package are installed. Defaults to empty.", - option => configuration.Version = option) + option => configuration.Version = option.remove_surrounding_quotes()) ; } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyPushCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyPushCommand.cs index 69c0387618..cb36695b79 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyPushCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyPushCommand.cs @@ -45,10 +45,10 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("s=|source=", "Source - The source we are pushing the package to. Use {0} to push to community feed.".format_with(ApplicationParameters.ChocolateyCommunityFeedPushSource), - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("k=|key=|apikey=|api-key=", "ApiKey - The api key for the source. If not specified (and not local file source), does a lookup. If not specified and one is not found for an https source, push will fail.", - option => configuration.PushCommand.Key = option) + option => configuration.PushCommand.Key = option.remove_surrounding_quotes()) .Add("t=|timeout=", "Timeout (in seconds) - The time to allow a package push to occur before timing out. Defaults to 300 seconds (5 minutes).", option => diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateySourceCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateySourceCommand.cs index e62cafa7f8..eafdcac8f4 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateySourceCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateySourceCommand.cs @@ -44,16 +44,16 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("n=|name=", "Name - the name of the source. Required with some actions. Defaults to empty.", - option => configuration.SourceCommand.Name = option) + option => configuration.SourceCommand.Name = option.remove_surrounding_quotes()) .Add("s=|source=", "Source - The source. Defaults to empty.", - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("u=|user=", "User - used with authenticated feeds. Defaults to empty.", - option => configuration.SourceCommand.Username = option) + option => configuration.SourceCommand.Username = option.remove_surrounding_quotes()) .Add("p=|password=", "Password - the user's password to the source. Encrypted in chocolatey.config file.", - option => configuration.SourceCommand.Password = option) + option => configuration.SourceCommand.Password = option.remove_surrounding_quotes()) ; } diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs index c1efca6fae..2cea4a1408 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUninstallCommand.cs @@ -40,13 +40,13 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati optionSet .Add("version=", "Version - A specific version to uninstall. Defaults to unspecified.", - option => configuration.Version = option) + option => configuration.Version = option.remove_surrounding_quotes()) .Add("a|allversions|all-versions", "AllVersions - Uninstall all versions? Defaults to false.", option => configuration.AllVersions = option != null) .Add("ua=|uninstallargs=|uninstallarguments=|uninstall-arguments=", "UninstallArguments - Uninstall Arguments to pass to the native installer in the package. Defaults to unspecified.", - option => configuration.InstallArguments = option) + option => configuration.InstallArguments = option.remove_surrounding_quotes()) .Add("o|override|overrideargs|overridearguments|override-arguments", "OverrideArguments - Should uninstall arguments be used exclusively without appending to current package passed arguments? Defaults to false.", option => configuration.OverrideArguments = option != null) @@ -55,7 +55,7 @@ public void configure_argument_parser(OptionSet optionSet, ChocolateyConfigurati option => configuration.NotSilent = option != null) .Add("params=|parameters=|pkgparameters=|packageparameters=|package-parameters=", "PackageParameters - Parameters to pass to the package. Defaults to unspecified.", - option => configuration.PackageParameters = option) + option => configuration.PackageParameters = option.remove_surrounding_quotes()) .Add("x|forcedependencies|force-dependencies|removedependencies|remove-dependencies", "RemoveDependencies - Uninstall dependencies when uninstalling package(s). Defaults to false.", option => configuration.ForceDependencies = option != null) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUpdateCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUpdateCommand.cs index ec01aa802b..ad9de73b2c 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUpdateCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUpdateCommand.cs @@ -35,10 +35,10 @@ public override void configure_argument_parser(OptionSet optionSet, ChocolateyCo optionSet .Add("s=|source=", "Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to default feeds.", - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("version=", "Version - A specific version to install. Defaults to unspecified.", - option => configuration.Version = option) + option => configuration.Version = option.remove_surrounding_quotes()) .Add("pre|prerelease", "Prerelease - Include Prereleases? Defaults to false.", option => configuration.Prerelease = option != null) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs index a040d2c260..2f352bad7f 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyUpgradeCommand.cs @@ -42,10 +42,10 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon optionSet .Add("s=|source=", "Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to default feeds.", - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("version=", "Version - A specific version to install. Defaults to unspecified.", - option => configuration.Version = option) + option => configuration.Version = option.remove_surrounding_quotes()) .Add("pre|prerelease", "Prerelease - Include Prereleases? Defaults to false.", option => configuration.Prerelease = option != null) @@ -54,7 +54,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon option => configuration.ForceX86 = option != null) .Add("ia=|installargs=|installarguments=|install-arguments=", "InstallArguments - Install Arguments to pass to the native installer in the package. Defaults to unspecified.", - option => configuration.InstallArguments = option) + option => configuration.InstallArguments = option.remove_surrounding_quotes()) .Add("o|override|overrideargs|overridearguments|override-arguments", "OverrideArguments - Should install arguments be used exclusively without appending to current package passed arguments? Defaults to false.", option => configuration.OverrideArguments = option != null) @@ -63,7 +63,7 @@ public virtual void configure_argument_parser(OptionSet optionSet, ChocolateyCon option => configuration.NotSilent = option != null) .Add("params=|parameters=|pkgparameters=|packageparameters=|package-parameters=", "PackageParameters - Parameters to pass to the package. Defaults to unspecified.", - option => configuration.PackageParameters = option) + option => configuration.PackageParameters = option.remove_surrounding_quotes()) .Add("m|sxs|sidebyside|side-by-side|allowmultiple|allow-multiple|allowmultipleversions|allow-multiple-versions", "AllowMultipleVersions - Should multiple versions of a package be installed? Defaults to false.", option => configuration.AllowMultipleVersions = option != null) diff --git a/src/chocolatey/infrastructure.app/commands/ChocolateyVersionCommand.cs b/src/chocolatey/infrastructure.app/commands/ChocolateyVersionCommand.cs index 621882149d..02f285fccc 100644 --- a/src/chocolatey/infrastructure.app/commands/ChocolateyVersionCommand.cs +++ b/src/chocolatey/infrastructure.app/commands/ChocolateyVersionCommand.cs @@ -41,7 +41,7 @@ public override void configure_argument_parser(OptionSet optionSet, ChocolateyCo optionSet .Add("s=|source=", "Source - The source to find the package(s) to install. Special sources include: ruby, webpi, cygwin, windowsfeatures, and python. Defaults to default feeds.", - option => configuration.Sources = option) + option => configuration.Sources = option.remove_surrounding_quotes()) .Add("lo|localonly", "LocalOnly - Only search against local machine items.", option => configuration.ListCommand.LocalOnly = option != null) From 76dfd597f16aa77fe50e8e93759da03eb7dcbbf7 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Fri, 6 Mar 2015 17:43:08 -0600 Subject: [PATCH 3/3] (GH-153) Upgrade -r should always return a value When running `upgrade --noop -r`, a value should always return the lastest version found, even if that is the version installed over the version available. --- .../services/NugetService.cs | 53 ++++++++++++++----- 1 file changed, 39 insertions(+), 14 deletions(-) diff --git a/src/chocolatey/infrastructure.app/services/NugetService.cs b/src/chocolatey/infrastructure.app/services/NugetService.cs index bfab25becb..cf28d204b5 100644 --- a/src/chocolatey/infrastructure.app/services/NugetService.cs +++ b/src/chocolatey/infrastructure.app/services/NugetService.cs @@ -457,15 +457,8 @@ packages as of version 1.0.0. That is what the install command is for. } var pkgInfo = _packageInfoService.get_package_information(installedPackage); - if (pkgInfo != null && pkgInfo.IsPinned) - { - string logMessage = "{0} is pinned. Skipping pinned package.".format_with(packageName); - var pinnedResults = packageInstalls.GetOrAdd(packageName, new PackageResult(packageName, null, null)); - pinnedResults.Messages.Add(new ResultMessage(ResultType.Warn, logMessage)); - pinnedResults.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); - if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, logMessage); - continue; - } + bool isPinned = pkgInfo != null && pkgInfo.IsPinned; + IPackage availablePackage = packageManager.SourceRepository.FindPackage(packageName, version, config.Prerelease, allowUnlisted: false); if (availablePackage == null) @@ -482,7 +475,15 @@ packages as of version 1.0.0. That is what the install command is for. { unfoundResults.Messages.Add(new ResultMessage(ResultType.Warn, logMessage)); unfoundResults.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); - if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) + { + this.Log().Warn(ChocolateyLoggers.Important, logMessage); + } + else + { + //last one is whether this package is pinned or not + this.Log().Info("{0}|{1}|{1}|{2}".format_with(installedPackage.Id, installedPackage.Version, isPinned.to_string().to_lower())); + } } continue; @@ -500,7 +501,14 @@ packages as of version 1.0.0. That is what the install command is for. string logMessage = "{0} v{1} is newer than the most recent.{2} You must be smarter than the average bear...".format_with(installedPackage.Id, installedPackage.Version, Environment.NewLine); results.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); - if (config.RegularOutput) this.Log().Info(ChocolateyLoggers.Important, logMessage); + if (config.RegularOutput) + { + this.Log().Info(ChocolateyLoggers.Important, logMessage); + } + else + { + this.Log().Info("{0}|{1}|{1}|{2}".format_with(installedPackage.Id, installedPackage.Version, isPinned.to_string().to_lower())); + } continue; } @@ -515,7 +523,15 @@ packages as of version 1.0.0. That is what the install command is for. results.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); } - if (config.RegularOutput) this.Log().Info(logMessage); + if (config.RegularOutput) + { + this.Log().Info(logMessage); + } + else + { + this.Log().Info("{0}|{1}|{2}|{3}".format_with(installedPackage.Id, installedPackage.Version, availablePackage.Version, isPinned.to_string().to_lower())); + } + continue; } @@ -536,11 +552,20 @@ packages as of version 1.0.0. That is what the install command is for. } else { - //last one is whether this package is pinned or not - this.Log().Info("{0}|{1}|{2}|{3}".format_with(installedPackage.Id, installedPackage.Version, availablePackage.Version, "false")); + this.Log().Info("{0}|{1}|{2}|{3}".format_with(installedPackage.Id, installedPackage.Version, availablePackage.Version, isPinned.to_string().to_lower())); } } + if (isPinned) + { + string logMessage = "{0} is pinned. Skipping pinned package.".format_with(packageName); + results.Messages.Add(new ResultMessage(ResultType.Warn, logMessage)); + results.Messages.Add(new ResultMessage(ResultType.Inconclusive, logMessage)); + if (config.RegularOutput) this.Log().Warn(ChocolateyLoggers.Important, logMessage); + + continue; + } + if (performAction) { try