X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=blobdiff_plain;f=libraries%2FifBuildable.hs;h=3f8813b63d66d7401c582d182f16a0f8e4e6723f;hp=f163ca22df27eab40813c7aabd4ce35d3edec57d;hb=d7d755865a3849be26a468a3fa430ff96c8e9e0c;hpb=e05f9de137269701df667b69d741dfae616694f7 diff --git a/libraries/ifBuildable.hs b/libraries/ifBuildable.hs index f163ca2..3f8813b 100644 --- a/libraries/ifBuildable.hs +++ b/libraries/ifBuildable.hs @@ -12,24 +12,25 @@ import System.IO main :: IO () main = do args <- getArgs case args of - [package] -> - doit package + [bootPackagesFile, package] -> + doit bootPackagesFile package _ -> - error "Syntax: ifBuildable " + error "Syntax: ifBuildable " -doit :: String -> IO () -doit package +doit :: FilePath -> String -> IO () +doit bootPackagesFile package = do setCurrentDirectory package unbuildable <- doesFileExist "unbuildable" if not unbuildable then exitWith ExitSuccess - else do mustBeBuildables <- getMustBeBuildablePackages + else do mustBeBuildables <- getMustBeBuildables bootPackagesFile if package `elem` mustBeBuildables then exitWith ExitSuccess else do hPutStrLn stderr "Warning: Package is unbuildable" exitWith (ExitFailure 1) -getMustBeBuildablePackages :: IO [String] -getMustBeBuildablePackages - = do xs <- readFile "../boot-packages" - return $ filter ("readline" /=) $ lines xs +getMustBeBuildables :: FilePath -> IO [String] +getMustBeBuildables bootPackagesFile + = do xs <- readFile bootPackagesFile + return $ filter ("editline" /=) $ lines xs +