packages feed

nemesis 2009.6.13.1 → 2009.6.13.2

raw patch · 7 files changed

+32/−13 lines, 7 filesdep +GlobPVP ok

version bump matches the API change (PVP)

Dependencies added: Glob

API changes (from Hackage documentation)

Files

Nemesis.hs view
@@ -1,7 +1,5 @@ -- template nemesis file -import System.Nemesis.DSL (clean)- nemesis = do      clean
changelog.md view
@@ -1,3 +1,10 @@+2009.6.13.2+-----------++### Fix++* use glob instead of zsh specific feature+ 2009.6.13.1 ----------- 
nemesis.cabal view
@@ -1,5 +1,5 @@ Name:                 nemesis-Version:              2009.6.13.1+Version:              2009.6.13.2 Build-type:           Simple Synopsis:             a rake like task management tool Description:@@ -18,7 +18,7 @@  library   ghc-options: -Wall-  build-depends: base >= 4 && < 5, haskell98, mtl, process, containers, data-default+  build-depends: base >= 4 && < 5, haskell98, mtl, process, containers, data-default, Glob >= 0.4   hs-source-dirs: src/   exposed-modules:                         System.Nemesis
readme.md view
@@ -4,8 +4,6 @@ Demo ----   -    import System.Nemesis.DSL (clean)-         nemesis = do        clean@@ -94,7 +92,7 @@     module Main where          import System.Nemesis (run)-    import System.Nemesis.DSL (desc, task, sh)+    import System.Nemesis.DSL      nemesis = do       task "i" (sh "ghci -isrc src/System/Nemesis.hs")
src/System/Nemesis/DSL.hs view
@@ -8,6 +8,9 @@ import System import System.Nemesis import System.Nemesis.Util+import System.FilePath.Glob+import Data.List (nub, sort)+import System.Directory  desc :: String -> Unit desc s = do@@ -38,4 +41,12 @@ clean :: [String] -> Unit clean xs = do   desc "Remove any temporary products. map (rm -rf)"-  task "clean" $ mapM_ (\x -> sh ("rm  -rf " ++ x)) xs+  task "clean" $ do+    paths <- globDir (xs.map compile) "." ^ fst ^ join' ^ nub ^ sort ^ reverse+    mapM_ rm_any paths+    where+      rm_any s = do+        file_exist <- doesFileExist s+        when file_exist $ rm s+        dir_exist <- doesDirectoryExist s+        when dir_exist $ rm_rf s
src/System/Nemesis/Runner.hs view
@@ -7,7 +7,7 @@ start = sep_block ++ start_nemesis ++ start_nemesis_dsl   where      start_nemesis     = "import System.Nemesis (run)\n"-    start_nemesis_dsl = "import System.Nemesis.DSL (sh, task, desc)\n"+    start_nemesis_dsl = "import System.Nemesis.DSL\n" end = sep_block ++ "main = run nemesis\n"  main :: IO ()@@ -21,10 +21,9 @@     else output $ h ++ start ++ t ++ end      system $ "ghc --make -O1 " ++ tmp_name ++ " -o " ++ bin-  system $ "rm " ++ tmp_name-  system $ "rm " ++ tmp_o-  system $ "rm " ++ tmp_hi-  return ()+  rm tmp_name+  rm tmp_o+  rm tmp_hi      where     get_name []     = error "Nemesis does not exists"
src/System/Nemesis/Util.hs view
@@ -62,3 +62,9 @@  ls :: String -> IO [String] ls s = getDirectoryContents s ^ (\\ [".", ".."])++rm :: String -> IO ()+rm = removeFile++rm_rf :: String -> IO ()+rm_rf = removeDirectoryRecursive