packages feed

hpack 0.33.0 → 0.33.0.1

raw patch · 3 files changed

+16/−5 lines, 3 filesPVP ok

version bump matches the API change (PVP)

API changes (from Hackage documentation)

Files

hpack.cabal view
@@ -1,13 +1,13 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.32.0.+-- This file has been generated from package.yaml by hpack version 0.33.0. -- -- see: https://github.com/sol/hpack ----- hash: dc706425edd9fa60b9662cefde8da5d890fb9cf19c8f0f9e01733b763bfcd06a+-- hash: 55dc38c5a69ab1a5dc744c1e8322a562cf343c8f4f84380100024f10784994b6  name:           hpack-version:        0.33.0+version:        0.33.0.1 synopsis:       A modern format for Haskell packages description:    See README at <https://github.com/sol/hpack#readme> category:       Development
src/Hpack.hs view
@@ -48,7 +48,7 @@ import           System.IO (stderr) import           Data.Aeson (Value) -import           Paths_hpack (version)+import           Paths_hpack () import           Hpack.Options import           Hpack.Config import           Hpack.Render@@ -56,6 +56,9 @@ import           Hpack.Utf8 as Utf8 import           Hpack.CabalFile +version :: Version+version = makeVersion [0,33,0]+ programVersion :: Version -> String programVersion v = "hpack version " ++ Version.showVersion v @@ -156,11 +159,11 @@  mkStatus :: [String] -> Version -> CabalFile -> Status mkStatus new v (CabalFile mOldVersion mHash old) = case (mOldVersion, mHash) of+  (_, _) | old == new -> OutputUnchanged   (Nothing, _) -> ExistingCabalFileWasModifiedManually   (Just oldVersion, _) | oldVersion < makeVersion [0, 20, 0] -> Generated   (_, Nothing) -> ExistingCabalFileWasModifiedManually   (Just oldVersion, Just hash)-    | old == new -> OutputUnchanged     | v < oldVersion -> AlreadyGeneratedByNewerHpack     | sha256 (unlines old) /= hash -> ExistingCabalFileWasModifiedManually     | otherwise -> Generated
test/HpackSpec.hs view
@@ -6,6 +6,7 @@ import qualified Prelude as Prelude  import           Control.DeepSeq+import           Data.List  import           Hpack.Config import           Hpack.CabalFile@@ -60,6 +61,13 @@             writeFile file existing             hpack `shouldReturn` modifiedManually             readFile file `shouldReturn` existing++          context "when only the the cabal file header changed" $ do+            it "does not complain if it's newer" $ do+              hpack `shouldReturn` generated+              let removeHash = unlines . filter (not . isInfixOf "hash") . lines+              readFile file >>= writeFile file . removeHash+              hpack `shouldReturn` outputUnchanged          context "when hash is present" $ do           context "when exsting cabal file was generated with a newer version of hpack" $ do