Skip to content

Commit

Permalink
(chocolateyGH-696) Approved/Failing statuses on install
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
ferventcoder committed Apr 19, 2016
1 parent 9696e21 commit 9c9bc8d
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/chocolatey/infrastructure.app/nuget/NugetCommon.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
Expand Down

0 comments on commit 9c9bc8d

Please sign in to comment.