packages feed

yjtools 0.9.10 → 0.9.11

raw patch · 3 files changed

+5/−63 lines, 3 filesdep −directorydep −old-timedep −processPVP: major bump suggested

API removals or changes: PVP suggests a major version bump

Dependencies removed: directory, old-time, process

API changes (from Hackage documentation)

- System.Directory.Tools: doesNotExistOrOldThan :: FilePath -> FilePath -> IO Bool
- System.Directory.Tools: maybeGetModificationTime :: FilePath -> IO (Maybe ClockTime)
- YJTools.Tribial: ghcMake :: String -> FilePath -> IO ExitCode
- YJTools.Tribial: updateFile_ :: (String -> Maybe String) -> (FilePath -> String) -> FilePath -> FilePath -> IO Bool

Files

− System/Directory/Tools.hs
@@ -1,21 +0,0 @@-module System.Directory.Tools (-  maybeGetModificationTime-, doesNotExistOrOldThan-) where--import System.Directory    (doesFileExist, getModificationTime)-import System.Time         (ClockTime)-import Control.Applicative ((<$>))-import Control.Monad.Tools (ifM)-import Control.Applicative (liftA2, (<$>))-import Data.Function       (on)--maybeGetModificationTime :: FilePath -> IO (Maybe ClockTime)-maybeGetModificationTime fn-  = ifM (doesFileExist fn)-        (Just <$> getModificationTime fn)-	(return Nothing)--doesNotExistOrOldThan :: FilePath -> FilePath -> IO Bool-doesNotExistOrOldThan dfn sfn-  = on (liftA2 (<)) maybeGetModificationTime dfn sfn
− YJTools/Tribial.hs
@@ -1,39 +0,0 @@-module YJTools.Tribial (-  ghcMake-, updateFile_-) where--import System.IO              (openFile, hClose, IOMode(WriteMode), hGetLine,-                               IOMode(ReadMode), withFile)-import System.IO.Unsafe       (unsafeInterleaveIO)-import System.Process         (runProcess, waitForProcess)-import System.Exit            (ExitCode(ExitSuccess))-import System.Directory       (doesFileExist)-import System.Directory.Tools (doesNotExistOrOldThan)-import Control.Exception      (bracket)-import Control.Monad.Tools    (ifM)-import Control.Applicative    ((<$>))--ghcMake :: String -> FilePath -> IO ExitCode-ghcMake exe dir = do-  let errFile = dir ++ "/" ++ exe ++ ".error"-  ret <- bracket (openFile errFile WriteMode) hClose $ \errH ->-           runProcess "ghc" [ "--make", exe ] (Just dir)-                      Nothing Nothing Nothing (Just errH) >>= waitForProcess-  case ret of-       ExitSuccess -> return ()-       _           -> readFile errFile >>= putStr-  return ret--updateFile_ :: (String -> Maybe String) -> (FilePath -> String) -> FilePath -> FilePath -> IO Bool-updateFile_ gtSrc hdr src dst-  = ifM ( not <$> doesFileExist dst-          `orIO`-          (/= Just src) . gtSrc <$> withFile dst ReadMode (hGetLine)-          `orIO`-          doesNotExistOrOldThan dst src )-      (readFile src >>= writeFile dst . ( (hdr src ++ "\n") ++ ) >> return True )-      (                                                             return False)-  where-  infixr 2 `orIO`-  orIO p1 p2     = do { b1 <- p1; b2 <- unsafeInterleaveIO p2; return $ b1 || b2 }
yjtools.cabal view
@@ -1,5 +1,5 @@ Name:		yjtools-Version:	0.9.10+Version:	0.9.11 Cabal-Version:	>= 1.2 Build-Type:	Simple License:	LGPL@@ -18,5 +18,7 @@ Extra-Tmp-Files:  Library-  Build-Depends:	base>3&&<5, process, directory, old-time-  Exposed-Modules:	Control.Monad.Tools, Control.Applicative.Tools, Data.List.Tools, Data.Function.Tools YJTools.Tribial System.Directory.Tools, Data.Bool.Tools+  Build-Depends:	base>3&&<5+  Exposed-Modules:	Control.Monad.Tools, Control.Applicative.Tools,+    Data.List.Tools, Data.Function.Tools,+    Data.Bool.Tools