codex 0.4.0.2 → 0.4.0.4
raw patch · 3 files changed
+22/−8 lines, 3 filesdep ~codexdep ~transformersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: codex, transformers
API changes (from Hackage documentation)
Files
- codex.cabal +3/−2
- codex/Main.hs +6/−1
- src/Codex.hs +13/−5
codex.cabal view
@@ -1,5 +1,5 @@ name: codex-version: 0.4.0.2+version: 0.4.0.4 synopsis: A ctags file generator for cabal project dependencies. description: This tool download and cache the source code of packages in your local hackage,@@ -74,9 +74,10 @@ , monad-loops >= 0.4.2 && < 0.5 , network >= 2.6 && < 2.7 , process+ , transformers , wreq , yaml - , codex == 0.4.0.2+ , codex == 0.4.0.4 source-repository head type: git
codex/Main.hs view
@@ -8,6 +8,7 @@ import Control.Arrow import Control.Exception (try, SomeException) import Control.Monad+import Control.Monad.IO.Class (liftIO) import Control.Monad.Trans.Either hiding (left, right) import Data.Either import Data.List@@ -93,7 +94,11 @@ Source Tagged -> return () Source Untagged -> tags bldr cx i >> getTags s i Archive -> extract hp i >> getTags s i- Remote -> fetch s hp i >> getTags s i+ Remote -> liftIO $ eitherT ignore return $ fetch s hp i >> getTags s i+ where+ ignore msg = do+ putStrLn $ concat ["codex: *warning* unable to fetch an archive for ", display i]+ return () help :: IO () help = putStrLn $
src/Codex.hs view
@@ -14,6 +14,7 @@ import Control.Monad.Trans.Either import Data.Machine import Data.Maybe+import Data.List ((\\)) import Distribution.Package import Distribution.Text import Distribution.Verbosity@@ -128,9 +129,9 @@ createDirectoryIfMissing True (packagePath root i) openLazyURI s url either left write bs where- write bs = fmap (const archivePath) $ tryIO $ BS.writeFile archivePath bs- archivePath = packageArchive root i- url = packageUrl i+ write bs = fmap (const archivePath) $ tryIO $ BS.writeFile archivePath bs+ archivePath = packageArchive root i+ url = packageUrl i openLazyURI :: WS.Session -> String -> IO (Either String BS.ByteString) openLazyURI s = fmap (bimap showHttpEx (^. W.responseBody)) . try . WS.get s where@@ -161,9 +162,16 @@ tags'' tmp (WorkspaceProject id' sources) = taggerCmdRun cx sources tags''' where tags''' = tmp </> concat [display id', ".tags"] mergeTags files' o' = do- contents <- traverse TLIO.readFile files'+ files'' <- filterM doesFileExist files'+ contents <- traverse TLIO.readFile files''+ case files' \\ files'' of+ [] -> return ()+ xs -> do+ putStrLn "codex: *warning* the following tags files where missings during assembly:"+ mapM_ putStrLn xs+ return () let xs = concat $ fmap TextL.lines contents- let ys = if sorted then (Set.toList . Set.fromList) xs else xs+ ys = if sorted then (Set.toList . Set.fromList) xs else xs TLIO.writeFile o' $ TextL.unlines (concat [headers, ys]) tags' = packageTags $ hackagePathOf bldr cx headers = if tagsFileHeader cx then fmap TextL.pack [headerFormat, headerSorted, headerHash] else []