pantry 0.5.0.0 → 0.5.1.0
raw patch · 5 files changed
+31/−33 lines, 5 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- ChangeLog.md +4/−0
- pantry.cabal +2/−3
- src/Pantry.hs +19/−16
- src/Pantry/Casa.hs +6/−4
- test/PantrySpec.hs +0/−10
ChangeLog.md view
@@ -1,5 +1,9 @@ # Changelog for pantry +## v0.5.1.0++* Catch all exceptions from Casa calls and recover+ ## v0.5.0.0 * Make the location of LTS/Nightly snapshots configurable
pantry.cabal view
@@ -4,10 +4,10 @@ -- -- see: https://github.com/sol/hpack ----- hash: 39397f3a78104fe1a4f1ef80cbd0e8af1fbaf10a9b5b4e18303bf7a3eafabc09+-- hash: 156d4b4d6df076864730cb8c7b4cb2c36fa1013a6790ed64c3de504f75bb4d58 name: pantry-version: 0.5.0.0+version: 0.5.1.0 synopsis: Content addressable Haskell package management description: Please see the README on Github at <https://github.com/commercialhaskell/pantry#readme> category: Development@@ -128,7 +128,6 @@ Pantry.InternalSpec Pantry.TreeSpec Pantry.TypesSpec- PantrySpec Paths_pantry hs-source-dirs: test
src/Pantry.hs view
@@ -375,14 +375,15 @@ -- Pull down those tree keys from Casa, automatically inserting into -- our local database. treeKeyBlobs :: Map TreeKey P.Tree <-- fmap+ handleAny (const mempty)+ (fmap Map.fromList (withStorage (runConduitRes (casaBlobSource (fmap unTreeKey (mapMaybe getRawTreeKey packageLocationsMissing)) .| mapMC parseTreeM .|- sinkList)))+ sinkList)))) pullTreeEnd <- liftIO getCurrentTime let pulledPackages = mapMaybe@@ -398,21 +399,23 @@ (\(P.TreeMap files) -> Set.fromList (map teBlob (toList files))) treeKeyBlobs pullBlobStart <- liftIO getCurrentTime- pulledBlobKeys :: Int <-- withStorage+ mpulledBlobKeys :: Maybe Int <-+ handleAny (const (pure Nothing))+ (fmap Just (withStorage (runConduitRes- (casaBlobSource uniqueFileBlobKeys .| mapC (const 1) .| sumC))- pullBlobEnd <- liftIO getCurrentTime- logDebug- ("Pulled from Casa: " <>- mconcat (List.intersperse ", " (map display pulledPackages)) <>- " (" <>- display (T.pack (show (diffUTCTime pullTreeEnd pullTreeStart))) <>- "), " <>- plural pulledBlobKeys "file" <>- " (" <>- display (T.pack (show (diffUTCTime pullBlobEnd pullBlobStart))) <>- ")")+ (casaBlobSource uniqueFileBlobKeys .| mapC (const 1) .| sumC))))+ for_ mpulledBlobKeys $ \pulledBlobKeys -> do+ pullBlobEnd <- liftIO getCurrentTime+ logDebug+ ("Pulled from Casa: " <>+ mconcat (List.intersperse ", " (map display pulledPackages)) <>+ " (" <>+ display (T.pack (show (diffUTCTime pullTreeEnd pullTreeStart))) <>+ "), " <>+ plural pulledBlobKeys "file" <>+ " (" <>+ display (T.pack (show (diffUTCTime pullBlobEnd pullBlobStart))) <>+ ")") -- Store the tree for each missing package. for_ packageLocationsMissing
src/Pantry/Casa.hs view
@@ -21,8 +21,9 @@ => TreeKey -> RIO env (Maybe (TreeKey, P.Tree)) casaLookupTree (P.TreeKey key) =- withStorage- (runConduitRes (casaBlobSource (Identity key) .| mapMC parseTreeM .| await))+ handleAny (const (pure Nothing))+ (withStorage+ (runConduitRes (casaBlobSource (Identity key) .| mapMC parseTreeM .| await))) -- | Lookup a single blob. If possible, prefer 'casaBlobSource', and -- query a group of keys at once, rather than one at a time. This will@@ -32,9 +33,10 @@ => BlobKey -> RIO env (Maybe ByteString) casaLookupKey key =- fmap+ handleAny (const (pure Nothing))+ (fmap (fmap snd)- (withStorage (runConduitRes (casaBlobSource (Identity key) .| await)))+ (withStorage (runConduitRes (casaBlobSource (Identity key) .| await)))) -- | A source of blobs given a set of keys. All blobs are -- automatically stored in the local pantry database.
− test/PantrySpec.hs
@@ -1,10 +0,0 @@-{-# LANGUAGE NoImplicitPrelude #-}-module PantrySpec (spec) where--import Test.Hspec-import Pantry-import RIO--spec :: Spec-spec = do- it "vacuums" $ runPantryAppClean pantryVacuum