1 -- Returns exitcode 0 if the given package is buildable or is a boot package,
4 module Main (main) where
7 import System.Directory
8 import System.Environment
13 main = do args <- getArgs
18 error "Syntax: ifBuildable <package>"
20 doit :: String -> IO ()
22 = do setCurrentDirectory package
23 unbuildable <- doesFileExist "unbuildable"
25 then exitWith ExitSuccess
26 else do mustBeBuildables <- getMustBeBuildablePackages
27 if package `elem` mustBeBuildables
28 then exitWith ExitSuccess
29 else do hPutStrLn stderr "Warning: Package is unbuildable"
30 exitWith (ExitFailure 1)
32 getMustBeBuildablePackages :: IO [String]
33 getMustBeBuildablePackages
34 = do xs <- readFile "../boot-packages"
35 return $ filter ("editline" /=) $ lines xs