fquery 0.2.1.3 → 0.2.1.4
raw patch · 5 files changed
+17/−5 lines, 5 files
Files
- Adelie/Depend.hs +2/−1
- Adelie/Provide.hs +2/−1
- Adelie/Use.hs +3/−2
- Adelie/Util.hs +8/−0
- fquery.cabal +2/−1
Adelie/Depend.hs view
@@ -19,6 +19,7 @@ import Text.ParserCombinators.Parsec.Token import Adelie.Portage+import qualified Adelie.Util as E type Version = String @@ -39,7 +40,7 @@ readDepend :: FilePath -> [String] -> IO [Dependency] readDepend fn iUse = do- r <- (start_parser fn) `catch` (\ _ -> return $ Right [])+ r <- (start_parser fn) `E.catchIOE` (\ _ -> return $ Right []) case r of Left err -> putStr "Parse error at " >> print err >> error "Aborting" Right x -> return $ nub x
Adelie/Provide.hs view
@@ -10,6 +10,7 @@ import Control.Monad (liftM) import Adelie.Portage+import qualified Adelie.Util as E ---------------------------------------------------------------- @@ -19,4 +20,4 @@ ---------------------------------------------------------------- readProvide :: FilePath -> IO [String]-readProvide fn = (liftM words (readFile fn)) `catch` (\ _ -> return [])+readProvide fn = (liftM words (readFile fn)) `E.catchIOE` (\ _ -> return [])
Adelie/Use.hs view
@@ -11,6 +11,7 @@ ) where import Data.List (nub, sort)+import qualified Adelie.Util as E import Control.Monad (liftM) import Adelie.Portage@@ -26,9 +27,9 @@ ---------------------------------------------------------------- readUse :: FilePath -> IO [String]-readUse fn = (liftM words $ readFile fn) `catch` (\ _ -> return [])+readUse fn = (liftM words $ readFile fn) `E.catchIOE` (\ _ -> return []) -- IUSE files sometimes have duplicate USE flags. I am not sure if it is the -- intended behaviour, but I filter them out. readIUse :: FilePath -> IO [String]-readIUse fn = (liftM (nub.sort.words) $ readFile fn) `catch` (\ _ -> return [])+readIUse fn = (liftM (nub.sort.words) $ readFile fn) `E.catchIOE` (\ _ -> return [])
+ Adelie/Util.hs view
@@ -0,0 +1,8 @@+module Adelie.Util (+ catchIOE+) where++import qualified Control.Exception as E++catchIOE :: IO a -> (E.IOException -> IO a) -> IO a+catchIOE = E.catch
fquery.cabal view
@@ -1,5 +1,5 @@ Name: fquery-Version: 0.2.1.3+Version: 0.2.1.4 Author: David Wang <millimillenary@gmail.com>, Sergei Trofimovich <slyfox@inbox.ru> Maintainer: Sergei Trofimovich <slyfox@inbox.ru>@@ -48,6 +48,7 @@ Adelie.QWant Adelie.Use Adelie.UseDesc+ Adelie.Util GHC-Options: -O2 -Wall -- GHC-Options: -Werror C-Sources: Adelie/opts.c