2 module Main (main) where
6 import System.Directory
7 import System.Environment
11 main = do args <- getArgs
14 error "No package or command given"
16 error "No command given"
17 package : prog : progArgs ->
18 do setCurrentDirectory package
19 unbuildable <- doesFileExist "unbuildable"
21 then do mustBeBuildables <- getMustBeBuildablePackages
22 when (package `elem` mustBeBuildables)
23 (error (package ++ " is unbuildable"))
24 else do ec <- rawSystem prog progArgs
27 getMustBeBuildablePackages :: IO [String]
28 getMustBeBuildablePackages
29 = do xs <- readFile "../core-packages"
30 return $ filter ("readline" /=) $ lines xs