darcs-benchmark 0.1.1 → 0.1.2
raw patch · 2 files changed
+11/−9 lines, 2 filesdep ~HTTP
Dependency ranges changed: HTTP
Files
- Download.hs +7/−7
- darcs-benchmark.cabal +4/−2
Download.hs view
@@ -1,8 +1,9 @@ module Download where +import Network.Browser import Network.URI-import Network.HTTP import Network.HTTP.Base+ import qualified Codec.Archive.Tar as Tar ( read, unpack ) import System.FilePath import System.Directory@@ -18,15 +19,14 @@ putStrLn $ "downloading and extracting: " ++ show url exist_dir <- doesDirectoryExist $ "repo" <.> repo exist_file <- doesFileExist $ "repo" <.> repo- let go = do rsp' <- simpleHTTP (mkRequest GET url)- rsp <- case rsp' of- Left e -> fail (show e)- Right x -> return x+ let go = do (_, rsp) <- browse $ do setCheckForProxy True+ setOutHandler (const $ return ())+ request (mkRequest GET url) when (rspCode rsp /= (2, 0, 0)) $ fail ("download failed: " ++ rspReason rsp) createDirectory $ "repo" <.> repo- bits <- getResponseBody rsp'- let entries = Tar.read $ decompress bits+ let bits = rspBody rsp+ entries = Tar.read $ decompress bits Tar.unpack ("repo" <.> repo) entries if (exist_dir || exist_file)
darcs-benchmark.cabal view
@@ -1,5 +1,5 @@ name: darcs-benchmark-version: 0.1.1+version: 0.1.2 synopsis: Comparative benchmark suite for darcs. description: A simple tool to compare performance of different Darcs 2.x@@ -27,7 +27,9 @@ build-depends: base < 5, process, mtl, tabular >= 0.2, time, regex-posix, html, filepath, directory,- containers, bytestring, network, HTTP >= 4000, tar, zlib+ containers, bytestring, network,+ HTTP >= 4000.0.8 && < 4000.1,+ tar, zlib main-is: main.hs other-modules: Shellish