From 9c9bc8d267aa152019fd9b78978cbc200aaf3a23 Mon Sep 17 00:00:00 2001 From: Rob Reynolds Date: Mon, 18 Apr 2016 10:50:07 -0500 Subject: [PATCH] (GH-696) Approved/Failing statuses on install Warn folks on install/upgrade if a package already has known failures. This same information is provided in search results and on the site, which could help them spend more time researching prior to attempting installs of bad packages. It's also helpful to know if this was an approved package that they were installing/upgrading. --- src/chocolatey/infrastructure.app/nuget/NugetCommon.cs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs b/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs index eae8c9b5d7..7cf9a46704 100644 --- a/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs +++ b/src/chocolatey/infrastructure.app/nuget/NugetCommon.cs @@ -117,11 +117,17 @@ public static IPackageManager GetPackageManager(ChocolateyConfiguration configur } //NOTE DO NOT EVER use this method - packageManager.PackageInstalling += (s, e) => - packageManager.PackageInstalled += (s, e) => { var pkg = e.Package; - "chocolatey".Log().Info(ChocolateyLoggers.Important, "{0}{1} v{2}{3}".format_with(Environment.NewLine, pkg.Id, pkg.Version.to_string(), configuration.Force ? " (forced)" : string.Empty)); + "chocolatey".Log().Info(ChocolateyLoggers.Important, "{0}{1} v{2}{3}{4}{5}".format_with( + Environment.NewLine, + pkg.Id, + pkg.Version.to_string(), + configuration.Force ? " (forced)" : string.Empty, + pkg.IsApproved ? " [Approved]" : string.Empty, + pkg.PackageTestResultStatus == "Failing" && pkg.IsDownloadCacheAvailable ? " - Likely broken for FOSS users (due to download location changes)" : pkg.PackageTestResultStatus == "Failing" ? " - Possibly broken" : string.Empty + )); if (installSuccessAction != null) installSuccessAction.Invoke(e); };