packages feed

angel 0.4.4 → 0.5.0

raw patch · 5 files changed

+25/−9 lines, 5 filesdep −MissingHdep ~processdep ~time

Dependencies removed: MissingH

Dependency ranges changed: process, time

Files

README.md view
@@ -286,6 +286,8 @@  CHANGELOG ---------+### 0.5.0+* Drop depdendency on MissingH  ### 0.4.4 
angel.cabal view
@@ -7,7 +7,7 @@ -- The package version. See the Haskell package versioning policy -- (http://www.haskell.org/haskellwiki/Package_versioning_policy) for -- standards guiding when and how versions should be incremented.-Version:             0.4.4+Version:             0.5.0  -- A short (one-line) description of the package. -- Synopsis:            @@ -69,9 +69,8 @@   -- Packages needed in order to build this package.   Build-depends: base >= 4.0 && < 5   -- binding to the internals of process here, gotta be careful-  Build-depends: process >= 1.0 && < 2.0+  Build-depends: process >= 1.2.0.0 && < 2.0   Build-depends: mtl-  Build-depends: MissingH   Build-depends: configurator >= 0.1   Build-depends: stm >= 2.0   Build-depends: containers >= 0.3@@ -108,7 +107,6 @@   Build-depends: base >= 4.0 && < 5   Build-depends: process >= 1.0 && < 2.0   Build-depends: mtl-  Build-depends: MissingH   Build-depends: configurator >= 0.1   Build-depends: stm >= 2.0   Build-depends: containers >= 0.3
src/Angel/Job.hs view
@@ -2,8 +2,6 @@                  , pollStale ) where  import Control.Exception ( finally )-import Data.String.Utils ( split-                         , strip ) import Data.Maybe ( mapMaybe                   , fromMaybe                   , fromJust )@@ -39,6 +37,8 @@                   , defaultStderr ) import qualified Angel.Data as D import Angel.Util ( sleepSecs+                  , strip+                  , split                   , nnull ) import Angel.Files ( getFile ) import Angel.PidFile ( startMaybeWithPidFile@@ -99,7 +99,7 @@     where         log = logger $ "- program: " ++ id ++ " -"         cmdSplit fullcmd = (head parts, tail parts) -            where parts = (filter (/="") . map strip . split " ") fullcmd+            where parts = (filter (/="") . map strip . split ' ') fullcmd          find_me cfg = M.findWithDefault defaultProgram id (spec cfg)         updateRunningPid my_spec mpid = atomically $ do 
src/Angel/PidFile.hs view
@@ -48,5 +48,5 @@  getPID :: ProcessHandle -> IO (Maybe PHANDLE) getPID pHandle = withProcessHandle pHandle getPID'-  where getPID' h @ (OpenHandle t) = return (h, Just t)-        getPID' h @ (ClosedHandle t) = return (h, Nothing)+  where getPID' h @ (OpenHandle t) = return (Just t)+        getPID' h @ (ClosedHandle t) = return Nothing
src/Angel/Util.hs view
@@ -2,12 +2,16 @@ module Angel.Util ( sleepSecs                   , waitForWake                   , expandPath+                  , split+                  , strip                   , nnull ) where  import Control.Concurrent import Control.Concurrent.STM import Control.Concurrent.STM.TVar (readTVar, writeTVar) import Control.Concurrent (threadDelay, forkIO, forkOS)+import Data.Char (isSpace)+import Data.Maybe (catMaybes) import System.Posix.User (getEffectiveUserName,                           UserEntry(homeDirectory),                           getUserEntryForName)@@ -36,3 +40,15 @@  nnull :: [a] -> Bool nnull = not . null++split :: Eq a => a -> [a] -> [[a]]+split a = catMaybes . foldr go []+  where+    go x acc = case (x == a, acc) of+      (True, xs) -> Nothing:xs+      (False, []) -> [Just [x]]+      (False, Nothing:rest) -> Just [x]:Nothing:rest+      (False, Just xs:rest) -> Just (x:xs):rest++strip :: String -> String+strip = reverse . dropWhile isSpace . reverse . dropWhile isSpace