Commit 24509440 authored by Ian Lynagh's avatar Ian Lynagh
Browse files

ifBuildable now prints a warning if the package is not buildable

parent e43dbbde
...@@ -6,6 +6,7 @@ import System.Cmd ...@@ -6,6 +6,7 @@ import System.Cmd
import System.Directory import System.Directory
import System.Environment import System.Environment
import System.Exit import System.Exit
import System.IO
main :: IO () main :: IO ()
main = do args <- getArgs main = do args <- getArgs
...@@ -15,14 +16,19 @@ main = do args <- getArgs ...@@ -15,14 +16,19 @@ main = do args <- getArgs
[_] -> [_] ->
error "No command given" error "No command given"
package : prog : progArgs -> package : prog : progArgs ->
do setCurrentDirectory package doit package prog progArgs
unbuildable <- doesFileExist "unbuildable"
if unbuildable doit :: String -> String -> [String] -> IO ()
then do mustBeBuildables <- getMustBeBuildablePackages doit package prog progArgs
when (package `elem` mustBeBuildables) = do setCurrentDirectory package
(error (package ++ " is unbuildable")) unbuildable <- doesFileExist "unbuildable"
else do ec <- rawSystem prog progArgs if unbuildable
exitWith ec then do mustBeBuildables <- getMustBeBuildablePackages
if package `elem` mustBeBuildables
then error (package ++ " is unbuildable")
else hPutStrLn stderr "Warning: Package is unbuildable"
else do ec <- rawSystem prog progArgs
exitWith ec
getMustBeBuildablePackages :: IO [String] getMustBeBuildablePackages :: IO [String]
getMustBeBuildablePackages getMustBeBuildablePackages
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment