Permalink
Browse files

Bumped version bounds, use extensible exceptions, bump version to 0.5…

….0.1.
  • Loading branch information...
1 parent 31d6615 commit 25b007e84c8fccedef22e65662d8af80af9930a6 John MacFarlane committed Oct 21, 2012
Showing with 10 additions and 9 deletions.
  1. +5 −4 Data/FileStore/Utils.hs
  2. +5 −5 filestore.cabal
View
@@ -1,4 +1,4 @@
-{-# LANGUAGE CPP #-}
+{-# LANGUAGE CPP, ScopedTypeVariables #-}
{- |
Module : Data.FileStore.Utils
Copyright : Copyright (C) 2009 John MacFarlane, Gwern Branwen
@@ -40,6 +40,7 @@ import System.IO (openTempFile, hClose)
import System.Process (runProcess, waitForProcess)
import qualified Data.ByteString.Lazy as B
import qualified Data.ByteString as S
+import qualified Control.Exception as E
#if MIN_VERSION_base(4,5,0)
#else
import Codec.Binary.UTF8.String (encodeString)
@@ -63,7 +64,7 @@ runShellCommand :: FilePath -- ^ Working directory
-> [String] -- ^ Arguments
-> IO (ExitCode, B.ByteString, B.ByteString)
runShellCommand workingDir environment command optionList = do
- tempPath <- catch getTemporaryDirectory (\_ -> return ".")
+ tempPath <- E.catch getTemporaryDirectory (\(_ :: E.SomeException) -> return ".")
(outputPath, hOut) <- openTempFile tempPath "out"
(errorPath, hErr) <- openTempFile tempPath "err"
hProcess <- runProcess (encodeArg command) (map encodeArg optionList) (Just workingDir) environment Nothing (Just hOut) (Just hErr)
@@ -81,7 +82,7 @@ mergeContents :: (String, B.ByteString) -- ^ (label, contents) of edited ver
-> (String, B.ByteString) -- ^ (label, contents) of latest version
-> IO (Bool, String) -- ^ (were there conflicts?, merged contents)
mergeContents (newLabel, newContents) (originalLabel, originalContents) (latestLabel, latestContents) = do
- tempPath <- catch getTemporaryDirectory (\_ -> return ".")
+ tempPath <- E.catch getTemporaryDirectory (\(_ :: E.SomeException) -> return ".")
(originalPath, hOriginal) <- openTempFile tempPath "orig"
(latestPath, hLatest) <- openTempFile tempPath "latest"
(newPath, hNew) <- openTempFile tempPath "new"
@@ -235,7 +236,7 @@ grepSearchRepo indexer repo query = do
-- | we don't actually need the contents, just want to check that the directory exists and we have enough permissions
withVerifyDir :: FilePath -> IO a -> IO a
withVerifyDir d a =
- catch (liftM head (getDirectoryContents $ encodeArg d) >> a) $ \e ->
+ E.catch (liftM head (getDirectoryContents $ encodeArg d) >> a) $ \(e :: E.SomeException) ->
if "No such file or directory" `isInfixOf` show e
then throwIO NotFound
else throwIO . UnknownError . show $ e
View
@@ -1,5 +1,5 @@
Name: filestore
-Version: 0.5
+Version: 0.5.0.1
Cabal-version: >= 1.8
Build-type: Custom
Synopsis: Interface for versioning file stores.
@@ -34,15 +34,15 @@ Flag maxcount
Library
Build-depends: base >= 4 && < 5,
bytestring >= 0.9 && < 1.0,
- containers >= 0.3 && < 0.5,
+ containers >= 0.3 && < 0.6,
utf8-string >= 0.3 && < 0.4,
filepath >= 1.1 && < 1.4,
- directory >= 1.0 && < 1.2,
+ directory >= 1.0 && < 1.3,
parsec >= 2 && < 3.2,
process >= 1.0 && < 1.2,
time >= 1.1 && < 1.5,
xml >= 1.3 && < 1.4,
- split >= 0.1 && < 0.2,
+ split >= 0.1 && < 0.3,
Diff >= 0.1.2 && < 0.2,
old-locale >= 1.0 && < 1.1
@@ -76,6 +76,6 @@ Executable test-filestore
time,
Diff,
filepath >= 1.1 && < 1.4,
- directory >= 1.1 && < 1.2,
+ directory >= 1.1 && < 1.3,
filestore

0 comments on commit 25b007e

Please sign in to comment.