filestore 0.3.4.2 → 0.3.4.3
raw patch · 3 files changed
+20/−10 lines, 3 filesPVP ok
version bump matches the API change (PVP)
API changes (from Hackage documentation)
Files
- CHANGES +6/−0
- Data/FileStore/Utils.hs +13/−9
- filestore.cabal +1/−1
CHANGES view
@@ -1,3 +1,9 @@+Version 0.3.4.3 released 26 Sep 2010++* runShellCommand: reverted to older version with temp files.+ The new version caused lazy-IO related problems with large+ files. Thanks to Pavel Perikov diagnosing the problem.+ Version 0.3.4.2 released 03 Aug 2010 * gitInit: Set up repository to allow push to the current
Data/FileStore/Utils.hs view
@@ -37,24 +37,28 @@ import System.Exit (ExitCode(..)) import System.FilePath ((</>), takeDirectory) import System.IO (openTempFile, hClose)-import System.Process (runInteractiveProcess, waitForProcess)+import System.Process (runProcess, waitForProcess) import qualified Data.ByteString.Lazy as B import Data.FileStore.Types (SearchMatch(..), FileStoreError(IllegalResourceName, NotFound, UnknownError), SearchQuery(..)) --- | Run shell command and return error status, standard output, and error--- output. Assumes UTF-8 locale. Note that this does not go through \/bin\/sh!+-- | Run shell command and return error status, standard output, and error output. Assumes+-- UTF-8 locale. Note that this does not actually go through \/bin\/sh! runShellCommand :: FilePath -- ^ Working directory -> Maybe [(String, String)] -- ^ Environment -> String -- ^ Command -> [String] -- ^ Arguments -> IO (ExitCode, B.ByteString, B.ByteString)-runShellCommand wd env cmd args = do- (hInp, hOut, hErr, ph) <- runInteractiveProcess (encodeString cmd) (map encodeString args) (Just wd) env- hClose hInp- output <- B.hGetContents hOut- errorOutput <- B.hGetContents hErr- status <- waitForProcess ph+runShellCommand workingDir environment command optionList = do+ tempPath <- catch getTemporaryDirectory (\_ -> return ".")+ (outputPath, hOut) <- openTempFile tempPath "out"+ (errorPath, hErr) <- openTempFile tempPath "err"+ hProcess <- runProcess (encodeString command) (map encodeString optionList) (Just workingDir) environment Nothing (Just hOut) (Just hErr)+ status <- waitForProcess hProcess+ errorOutput <- B.readFile errorPath+ output <- B.readFile outputPath+ removeFile errorPath+ removeFile outputPath return (status, errorOutput, output) -- | Do a three way merge, using either git merge-file or RCS merge. Assumes
filestore.cabal view
@@ -1,5 +1,5 @@ Name: filestore-Version: 0.3.4.2+Version: 0.3.4.3 Cabal-version: >= 1.2 Build-type: Custom Tested-with: GHC==6.10.1