Skip to content

Commit

Permalink
running the pipe part
Browse files Browse the repository at this point in the history
  • Loading branch information
phischu committed Mar 24, 2013
1 parent 5edc790 commit 5016090
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Master.hs
Expand Up @@ -42,6 +42,7 @@ newtype CreateModuleList = CreateModuleList Package deriving (Show,Typeable,Eq,H
newtype ModuleList = ModuleList [Module] deriving (Show,Typeable,Eq,Hashable,Binary,NFData,Read) newtype ModuleList = ModuleList [Module] deriving (Show,Typeable,Eq,Hashable,Binary,NFData,Read)
newtype GetAST = GetAST (Package,Module) deriving (Show,Typeable,Eq,Hashable,Binary,NFData) newtype GetAST = GetAST (Package,Module) deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
newtype CreatePackageList = CreatePackageList () deriving (Show,Typeable,Eq,Hashable,Binary,NFData) newtype CreatePackageList = CreatePackageList () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)
newtype RunMasterPipe = RunMasterPipe () deriving (Show,Typeable,Eq,Hashable,Binary,NFData)


instance Rule ExtractedPackage () where instance Rule ExtractedPackage () where
storedValue (ExtractedPackage (Package (name,version))) = do storedValue (ExtractedPackage (Package (name,version))) = do
Expand All @@ -66,6 +67,9 @@ instance Rule CreatePackageList () where
exists <- IO.doesFileExist "packages.list" exists <- IO.doesFileExist "packages.list"
if exists then return (Just ()) else return Nothing if exists then return (Just ()) else return Nothing


instance Rule RunMasterPipe () where
storedValue _ = return Nothing

instance Rule GetAST () where instance Rule GetAST () where
storedValue = undefined storedValue = undefined


Expand Down Expand Up @@ -94,7 +98,8 @@ main = shakeArgs shakeOptions {shakeThreads = 4} $ do
action (do action (do
PackageList packages <- apply1 (GetPackageList ()) PackageList packages <- apply1 (GetPackageList ())
apply (map ExtractedPackage packages) :: Action [()] apply (map ExtractedPackage packages) :: Action [()]
apply1 (CreatePackageList ()) :: Action ()) apply1 (CreatePackageList ()) :: Action ()
apply1 (RunMasterPipe ()) :: Action ())


rule (\(GetPackageList ()) -> Just (do rule (\(GetPackageList ()) -> Just (do
need ["00-index.tar"] need ["00-index.tar"]
Expand Down Expand Up @@ -133,6 +138,8 @@ main = shakeArgs shakeOptions {shakeThreads = 4} $ do
need [cabalfile] need [cabalfile]
liftIO (createModuleList package)) liftIO (createModuleList package))


rule (\(RunMasterPipe ()) -> Just (liftIO MasterPipe.masterpipe))

rule (\(GetAST (package,modul))-> Just $ do rule (\(GetAST (package,modul))-> Just $ do
return ()) return ())


Expand Down
1 change: 1 addition & 0 deletions MasterPipe.hs
Expand Up @@ -58,6 +58,7 @@ saveConfigurations () = runIdentityP $ forever $ do
if exists if exists
then respond (package,configuration) then respond (package,configuration)
else do else do
createDirectoryIfMissing True path
lift (writeFile path (show configuration)) lift (writeFile path (show configuration))
respond (package,configuration) respond (package,configuration)


Expand Down

0 comments on commit 5016090

Please sign in to comment.