on master help sign in
Added --no-platform option
dd595abMichael Snoyman
app/stackage.hs+5−2
@@ -9,15 +9,17 @@ import System.IO (hFlush, stdout)
9data BuildArgs = BuildArgs
9data BuildArgs = BuildArgs
10 { noClean :: Bool
10 { noClean :: Bool
11 , excluded :: [String]
11 , excluded :: [String]
12+ , noPlatform :: Bool
12 }
13 }
13
14
14parseBuildArgs :: [String] -> IO BuildArgs
15parseBuildArgs :: [String] -> IO BuildArgs
15parseBuildArgs =
16parseBuildArgs =
16− loop $ BuildArgs False []
17+ loop $ BuildArgs False [] False
17 where
18 where
18 loop x [] = return x
19 loop x [] = return x
19 loop x ("--no-clean":rest) = loop x { noClean = True } rest
20 loop x ("--no-clean":rest) = loop x { noClean = True } rest
20 loop x ("--exclude":y:rest) = loop x { excluded = y : excluded x } rest
21 loop x ("--exclude":y:rest) = loop x { excluded = y : excluded x } rest
22+ loop x ("--no-platform":rest) = loop x { noPlatform = True } rest
21 loop _ (y:_) = error $ "Did not understand argument: " ++ y
23 loop _ (y:_) = error $ "Did not understand argument: " ++ y
22
24
23main :: IO ()
25main :: IO ()
@@ -29,6 +31,7 @@ main = do
29 build defaultBuildSettings
31 build defaultBuildSettings
30 { cleanBeforeBuild = not noClean
32 { cleanBeforeBuild = not noClean
31 , excludedPackages = fromList $ map PackageName excluded
33 , excludedPackages = fromList $ map PackageName excluded
34+ , requireHaskellPlatform = not noPlatform
32 }
35 }
33 ["init"] -> do
36 ["init"] -> do
34 putStrLn "Note: init isn't really ready for prime time use."
37 putStrLn "Note: init isn't really ready for prime time use."
@@ -46,5 +49,5 @@ main = do
46 putStrLn "Available commands:"
49 putStrLn "Available commands:"
47 putStrLn " update Download updated Stackage databases. Automatically calls init."
50 putStrLn " update Download updated Stackage databases. Automatically calls init."
48 putStrLn " init Initialize your cabal file to use Stackage"
51 putStrLn " init Initialize your cabal file to use Stackage"
49− putStrLn " build [--no-clean] [--exclude package...]"
52+ putStrLn " build [--no-clean] [--no-platform] [--exclude package...]"
50 putStrLn " Build the package databases (maintainers only)"
53 putStrLn " Build the package databases (maintainers only)"