stackage-curator 0.7.0.5 → 0.7.1
raw patch · 4 files changed
+39/−1 lines, 4 files
Files
- ChangeLog.md +4/−0
- Stackage/Stats.hs +23/−0
- app/stackage.hs +10/−0
- stackage-curator.cabal +2/−1
ChangeLog.md view
@@ -1,3 +1,7 @@+## 0.7.1++* Add the `stats` command+ ## 0.7.0.4 * Respect --summary option
+ Stackage/Stats.hs view
@@ -0,0 +1,23 @@+{-# LANGUAGE OverloadedStrings, NoImplicitPrelude #-}+module Stackage.Stats+ ( printStats+ ) where++import Stackage.Prelude+import Data.Yaml (decodeFileEither)++printStats :: FilePath -- ^ YAML build plan file+ -> IO ()+printStats fp = do+ bp <- decodeFileEither (fpToString fp) >>= either throwIO return+ let core = length $ siCorePackages $ bpSystemInfo bp+ pkgs = length $ bpPackages bp+ maintainers = length $ asSet $ flip foldMap (bpPackages bp)+ $ maybe+ mempty+ singletonSet+ . pcMaintainer . ppConstraints+ putStrLn $ "Core packages: " ++ tshow core+ putStrLn $ "Non-core packages: " ++ tshow pkgs+ putStrLn $ "Total packages: " ++ tshow (core + pkgs)+ putStrLn $ "Unique maintainers: " ++ tshow maintainers
app/stackage.hs view
@@ -12,6 +12,7 @@ import Stackage.CompleteBuild import Stackage.Upload import Stackage.InstallBuild+import Stackage.Stats import Network.HTTP.Client (withManager) import Network.HTTP.Client.TLS (tlsManagerSettings) import qualified Data.Text as T@@ -76,6 +77,11 @@ uploadv2Flags "upload2" "Upload a pre-existing v2 bundle"+ , cmnd+ printStats+ printStatsFlags+ "stats"+ "Print statistics on a build plan" ] cmnd exec parse name desc =@@ -220,3 +226,7 @@ <> help "Used to run old LTS minor bumps, and rerun broken builds" <> value "" ) ) )++ printStatsFlags = fmap decodeString $ strArgument+ $ metavar "YAML-FILE"+ <> help "YAML file containing a build plan"
stackage-curator.cabal view
@@ -1,5 +1,5 @@ name: stackage-curator-version: 0.7.0.5+version: 0.7.1 synopsis: Tools for curating Stackage bundles description: Please see <http://www.stackage.org/package/stackage-curator> for a description and documentation. homepage: https://github.com/fpco/stackage@@ -28,6 +28,7 @@ Stackage.InstallBuild Stackage.PackageDescription Stackage.ServerBundle+ Stackage.Stats Stackage.Upload Stackage.PerformBuild Stackage.CompleteBuild