cabal-plan 0.1.0.0 → 0.1.1.0
raw patch · 3 files changed
+26/−2 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +5/−0
- cabal-plan.cabal +2/−1
- src-exe/cabal-plan.hs +19/−1
ChangeLog.md view
@@ -1,5 +1,10 @@ # Revision history for `cabal-plan` +## 0.1.1.0++* Add `cabal-plan fingerprint` command for printing+ sha256 sums of source tarballs+ ## 0.1.0.0 * First version. Released on an unsuspecting world.
cabal-plan.cabal view
@@ -1,5 +1,5 @@ name: cabal-plan-version: 0.1.0.0+version: 0.1.1.0 synopsis: Library and utiltity for processing cabal's plan.json file homepage: https://github.com/hvr/cabal-plan license: GPL-3@@ -10,6 +10,7 @@ category: Development build-type: Simple cabal-version: >=1.10+tested-with: GHC==8.0.2, GHC==7.10.3, GHC==7.8.4, GHC==7.6.3 description: This package provides a library for decoding @plan.json@ files as well as simple tool @cabal-plan@ for extracting and pretty printing
src-exe/cabal-plan.hs view
@@ -1,4 +1,5 @@ {-# LANGUAGE RecordWildCards #-}+{-# LANGUAGE OverloadedStrings #-} module Main where @@ -10,6 +11,7 @@ import Data.Set (Set) import qualified Data.Set as S import qualified Data.Text as T+import qualified Data.Text.IO as T import qualified Data.Text.Lazy as LT import qualified Data.Text.Lazy.Builder as LT import qualified Data.Text.Lazy.IO as LT@@ -27,7 +29,8 @@ ("info":_) -> doInfo ("show":_) -> print =<< findAndDecodePlanJson ("list-bin":_) -> doListBin- _ -> fail "unknown command (known commands: info show list-bin)"+ ("fingerprint":_) -> doFingerprint+ _ -> fail "unknown command (known commands: info show list-bin fingerprint)" doListBin :: IO () doListBin = do@@ -43,6 +46,21 @@ CompNameLib -> T.unpack (pn <> T.pack":lib:" <> pn) _ -> T.unpack (pn <> T.pack":" <> dispCompName cn) putStrLn (g ++ " " ++ fn)++doFingerprint :: IO ()+doFingerprint = do+ (v,_projbase) <- findAndDecodePlanJson++ let pids = M.fromList [ (uPId u, u) | (_,u) <- M.toList (pjUnits v) ]++ forM_ (M.toList pids) $ \(_,Unit{..}) -> do+ let h = maybe "________________________________________________________________"+ dispSha256 $ uSha256+ case uType of+ UnitTypeBuiltin -> T.putStrLn (h <> " B " <> dispPkgId uPId)+ UnitTypeGlobal -> T.putStrLn (h <> " G " <> dispPkgId uPId)+ UnitTypeLocal -> T.putStrLn (h <> " L " <> dispPkgId uPId)+ UnitTypeInplace -> T.putStrLn (h <> " I " <> dispPkgId uPId) doInfo :: IO () doInfo = do