Skip to content

Commit

Permalink
Complete lts11.13 transition
Browse files Browse the repository at this point in the history
  • Loading branch information
tmspzz committed Jun 19, 2018
1 parent c55f976 commit 91a5e2f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
10 changes: 5 additions & 5 deletions src/Caches/Local/Downloading.hs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import Control.Monad.Except
import Control.Monad.Trans.Resource (runResourceT)
import qualified Data.ByteString.Lazy as LBS
import Data.Carthage.TargetPlatform
import qualified Data.Conduit as C (($$))
import qualified Data.Conduit as C (runConduit, (.|))
import qualified Data.Conduit.Binary as C (sinkLbs, sourceFile)
import Data.Romefile
import System.Directory
Expand Down Expand Up @@ -37,7 +37,7 @@ getFrameworkFromLocalCache lCacheDir
platform = do
frameworkExistsInLocalCache <- liftIO . doesFileExist $ frameworkLocalCachePath prefix
if frameworkExistsInLocalCache
then liftIO . runResourceT $ C.sourceFile (frameworkLocalCachePath prefix) C.$$ C.sinkLbs
then liftIO . runResourceT . C.runConduit $ C.sourceFile (frameworkLocalCachePath prefix) C..| C.sinkLbs
else throwError $ "Error: could not find " <> fwn <> " in local cache at : " <> frameworkLocalCachePath prefix
where
frameworkLocalCachePath cPrefix = lCacheDir </> cPrefix </> remoteFrameworkUploadPath
Expand All @@ -57,7 +57,7 @@ getVersionFileFromLocalCache lCacheDir
versionFileExistsInLocalCache <- liftIO . doesFileExist $ versionFileLocalCachePath

if versionFileExistsInLocalCache
then liftIO . runResourceT $ C.sourceFile versionFileLocalCachePath C.$$ C.sinkLbs
then liftIO . runResourceT . C.runConduit $ C.sourceFile versionFileLocalCachePath C..| C.sinkLbs
else throwError $ "Error: could not find " <> versionFileName <> " in local cache at : " <> versionFileLocalCachePath
where
versionFileName = versionFileNameForGitRepoName $ fst gitRepoNameAndVersion
Expand All @@ -84,7 +84,7 @@ getBcsymbolmapFromLocalCache lCacheDir
let finalBcsymbolmapLocalPath = bcsymbolmapLocalCachePath prefix
bcSymbolmapExistsInLocalCache <- liftIO . doesFileExist $ finalBcsymbolmapLocalPath
if bcSymbolmapExistsInLocalCache
then liftIO . runResourceT $ C.sourceFile finalBcsymbolmapLocalPath C.$$ C.sinkLbs
then liftIO . runResourceT . C.runConduit $ C.sourceFile finalBcsymbolmapLocalPath C..| C.sinkLbs
else throwError $ "Error: could not find " <> bcsymbolmapName <> " in local cache at : " <> finalBcsymbolmapLocalPath
where
remoteBcsymbolmapUploadPath = remoteBcsymbolmapPath dwarfUUID platform reverseRomeMap f version
Expand All @@ -109,7 +109,7 @@ getDSYMFromLocalCache lCacheDir
let finalDSYMLocalPath = dSYMLocalCachePath prefix
dSYMExistsInLocalCache <- liftIO . doesFileExist $ finalDSYMLocalPath
if dSYMExistsInLocalCache
then liftIO . runResourceT $ C.sourceFile finalDSYMLocalPath C.$$ C.sinkLbs
then liftIO . runResourceT . C.runConduit $ C.sourceFile finalDSYMLocalPath C..| C.sinkLbs
else throwError $ "Error: could not find " <> dSYMName <> " in local cache at : " <> finalDSYMLocalPath
where
dSYMLocalCachePath cPrefix = lCacheDir </> cPrefix </> remotedSYMUploadPath
Expand Down
4 changes: 2 additions & 2 deletions src/Caches/S3/Downloading.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import Data.Carthage.TargetPlatform
import qualified Data.Conduit as C (ConduitT, await, yield,
(=$=))
(.|))
import qualified Data.Conduit.Binary as C (sinkLbs)
import Data.Either (lefts)
import Data.Maybe (fromMaybe)
Expand Down Expand Up @@ -228,7 +228,7 @@ downloadBinary s3BucketName objectRemotePath objectName = do

where
objectKey = S3.ObjectKey . T.pack $ objectRemotePath
sink verbose totalLength = if verbose then printProgress objectName totalLength C.=$= C.sinkLbs else C.sinkLbs
sink verbose totalLength = if verbose then printProgress objectName totalLength C..| C.sinkLbs else C.sinkLbs

printProgress :: MonadIO m => String -> Int -> C.ConduitT BS.ByteString BS.ByteString m ()
printProgress objName totalLength = loop totalLength 0 0
Expand Down

0 comments on commit 91a5e2f

Please sign in to comment.