Skip to content

Commit

Permalink
(maint) Whitespace changes
Browse files Browse the repository at this point in the history
  • Loading branch information
gep13 committed Feb 27, 2018
1 parent a78322d commit a7c1ff8
Showing 1 changed file with 29 additions and 29 deletions.
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
// Copyright © 2017 - 2018 Chocolatey Software, Inc
// Copyright © 2011 - 2017 RealDimensions Software, LLC
//
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
//
//
// You may obtain a copy of the License at
//
//
// http://www.apache.org/licenses/LICENSE-2.0
//
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
Expand Down Expand Up @@ -56,35 +56,35 @@ public class ChocolateyPackageService : IChocolateyPackageService
private readonly IList<string> _proBusinessMessages = new List<string> {
@"
Are you ready for the ultimate experience? Check out Pro / Business!
https://chocolatey.org/compare"
,
https://chocolatey.org/compare"
,
@"
Enjoy using Chocolatey? Explore more amazing features to take your
experience to the next level at
https://chocolatey.org/compare"
,
https://chocolatey.org/compare"
,
@"
Did you know the proceeds of Pro (and some proceeds from other
licensed editions) go into bettering the community infrastructure?
Your support ensures an active community, keeps Chocolatey tip top,
plus it nets you some awesome features!
https://chocolatey.org/compare",
https://chocolatey.org/compare",
@"
Did you know some organizations use Chocolatey completely internally
without using the community repository or downloads from the internet?
Wait until you see how Package Builder and Package Internalizer can
help you achieve more, quicker and easier! Get your trial started
today at https://chocolatey.org/compare",
today at https://chocolatey.org/compare",
@"
An organization needed total software management life cycle automation.
They evaluated Chocolatey for Business. You won't believe what happens
next!
https://chocolatey.org/compare",
https://chocolatey.org/compare",
@"
Did you know that Package Synchronizer and AutoUninstaller enhancements
in licensed versions are up to 95% effective in removing system
installed software without an uninstall script? Find out more at
https://chocolatey.org/compare",
https://chocolatey.org/compare",
@"
Did you know Chocolatey goes to eleven? And it turns great developers /
system admins into something amazing! Singlehandedly solve your
Expand Down Expand Up @@ -284,7 +284,7 @@ public void push_run(ChocolateyConfiguration config)

public void install_noop(ChocolateyConfiguration config)
{
// each package can specify its own configuration values
// each package can specify its own configuration values
foreach (var packageConfig in set_config_from_package_names_and_packages_config(config, new ConcurrentDictionary<string, PackageResult>()).or_empty_list_if_null())
{
Action<PackageResult> action = null;
Expand Down Expand Up @@ -314,8 +314,8 @@ public void randomly_notify_about_pro_business(ChocolateyConfiguration config, s
{
if (string.IsNullOrWhiteSpace(message))
{
// Choose a message at random to display. It is
// specifically done like this as sometimes Random
// Choose a message at random to display. It is
// specifically done like this as sometimes Random
// doesn't like to grab the max value.
var messageCount = _proBusinessMessages.Count;
var chosenMessage = new Random().Next(0, messageCount);
Expand Down Expand Up @@ -354,7 +354,7 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu
var installersDifferences = _registryService.get_installer_key_differences(installersBefore, _registryService.get_installer_keys());
if (installersDifferences.RegistryKeys.Count != 0)
{
//todo v1 - note keys passed in
//todo v1 - note keys passed in
pkgInfo.RegistrySnapshot = installersDifferences;

var key = installersDifferences.RegistryKeys.FirstOrDefault();
Expand Down Expand Up @@ -404,7 +404,7 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu
Environment.SetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyPackageInstallLocation, toolsLocation, EnvironmentVariableTarget.Process);
}
}

if (pkgInfo.RegistrySnapshot != null && pkgInfo.RegistrySnapshot.RegistryKeys.Any(k => !string.IsNullOrWhiteSpace(k.InstallLocation)))
{
var key = pkgInfo.RegistrySnapshot.RegistryKeys.FirstOrDefault(k => !string.IsNullOrWhiteSpace(k.InstallLocation));
Expand All @@ -431,7 +431,7 @@ public void handle_package_result(PackageResult packageResult, ChocolateyConfigu
}

remove_rollback_if_exists(packageResult);

this.Log().Info(ChocolateyLoggers.Important, " The {0} of {1} was successful.".format_with(commandName.to_string(), packageResult.Name));

var installLocation = Environment.GetEnvironmentVariable(ApplicationParameters.Environment.ChocolateyPackageInstallLocation);
Expand Down Expand Up @@ -479,26 +479,26 @@ private string capture_arguments(ChocolateyConfiguration config, PackageResult p
if (config.Prerelease) arguments.Append(" --prerelease");
if (config.IgnoreDependencies) arguments.Append(" --ignore-dependencies");
if (config.ForceX86) arguments.Append(" --forcex86");

if (!string.IsNullOrWhiteSpace(config.InstallArguments)) arguments.Append(" --install-arguments=\"'{0}'\"".format_with(config.InstallArguments));
if (config.OverrideArguments) arguments.Append(" --override-arguments");
if (config.ApplyInstallArgumentsToDependencies) arguments.Append(" --apply-install-arguments-to-dependencies");

if (!string.IsNullOrWhiteSpace(config.PackageParameters)) arguments.Append(" --package-parameters=\"'{0}'\"".format_with(config.PackageParameters));
if (config.ApplyPackageParametersToDependencies) arguments.Append(" --apply-package-parameters-to-dependencies");

if (config.AllowDowngrade) arguments.Append(" --allow-downgrade");
if (config.AllowMultipleVersions) arguments.Append(" --allow-multiple-versions");

// most times folks won't want to skip automation scripts on upgrade
//if (config.SkipPackageInstallProvider) arguments.Append(" --skip-automation-scripts");
//if (config.UpgradeCommand.FailOnUnfound) arguments.Append(" --fail-on-unfound");

if (!string.IsNullOrWhiteSpace(config.SourceCommand.Username)) arguments.Append(" --user=\"'{0}'\"".format_with(config.SourceCommand.Username));
if (!string.IsNullOrWhiteSpace(config.SourceCommand.Password)) arguments.Append(" --password=\"'{0}'\"".format_with(config.SourceCommand.Password));
if (!string.IsNullOrWhiteSpace(config.SourceCommand.Password)) arguments.Append(" --password=\"'{0}'\"".format_with(config.SourceCommand.Password));
if (!string.IsNullOrWhiteSpace(config.SourceCommand.Certificate)) arguments.Append(" --cert=\"'{0}'\"".format_with(config.SourceCommand.Certificate));
if (!string.IsNullOrWhiteSpace(config.SourceCommand.CertificatePassword)) arguments.Append(" --certpassword=\"'{0}'\"".format_with(config.SourceCommand.CertificatePassword));

// this should likely be limited
//if (!config.Features.ChecksumFiles) arguments.Append(" --ignore-checksums");
//if (!config.Features.AllowEmptyChecksums) arguments.Append(" --allow-empty-checksums");
Expand Down Expand Up @@ -544,7 +544,7 @@ public ConcurrentDictionary<string, PackageResult> install_run(ChocolateyConfigu
{
action = (packageResult) => handle_package_result(packageResult, packageConfig, CommandNameType.install);
}

var results = perform_source_runner_function(packageConfig, r => r.install_run(packageConfig, action));

foreach (var result in results)
Expand Down Expand Up @@ -633,8 +633,8 @@ private IEnumerable<ChocolateyConfiguration> set_config_from_package_names_and_p
private bool contains_packages_config_file(string packageNames)
{
return packageNames.to_string().Split(new[] { ApplicationParameters.PackageNamesSeparator }, StringSplitOptions.RemoveEmptyEntries).or_empty_list_if_null().Any(p => p.EndsWith(".config", StringComparison.OrdinalIgnoreCase));
}
}

private bool is_packages_config_file(string packageNames)
{
return packageNames.to_string().EndsWith(".config", StringComparison.OrdinalIgnoreCase) && !packageNames.to_string().contains(";");
Expand Down Expand Up @@ -727,15 +727,15 @@ public ConcurrentDictionary<string, PackageResult> upgrade_run(ChocolateyConfigu

var beforeUpgradeAction = new Action<PackageResult>(packageResult => before_package_modify(packageResult, config));
var packageUpgrades = perform_source_runner_function(config, r => r.upgrade_run(config, action, beforeUpgradeAction));

var upgradeFailures = report_action_summary(packageUpgrades, "upgraded");
if (upgradeFailures != 0 && Environment.ExitCode == 0)
{
Environment.ExitCode = 1;
}

randomly_notify_about_pro_business(config);

return packageUpgrades;
}

Expand Down

0 comments on commit a7c1ff8

Please sign in to comment.