summaryrefslogtreecommitdiff
path: root/libraries/cabal-bin.hs
diff options
context:
space:
mode:
authorIan Lynagh <igloo@earth.li>2008-07-29 20:24:10 +0000
committerIan Lynagh <igloo@earth.li>2008-07-29 20:24:10 +0000
commita452fa83dd70fa01a049fbb59d1c829832af0191 (patch)
tree3274aaf2dd88d556f94de553cb845a141df4f327 /libraries/cabal-bin.hs
parentfd1896cbbc3985f908ca9a57aa0055790ce198f5 (diff)
downloadhaskell-a452fa83dd70fa01a049fbb59d1c829832af0191.tar.gz
Make cabal-bin not do any building, even of Setup.hs, when it is asked to clean
Diffstat (limited to 'libraries/cabal-bin.hs')
-rw-r--r--libraries/cabal-bin.hs12
1 files changed, 10 insertions, 2 deletions
diff --git a/libraries/cabal-bin.hs b/libraries/cabal-bin.hs
index 1ecba50a3d..ed72a1e6e7 100644
--- a/libraries/cabal-bin.hs
+++ b/libraries/cabal-bin.hs
@@ -1,6 +1,7 @@
module Main (main) where
+import Control.Monad
import Data.Maybe
import Distribution.PackageDescription
import Distribution.PackageDescription.Parse
@@ -45,7 +46,14 @@ doit verbosity ghc packageConf args = do
runSetup :: Verbosity -> FilePath -> FilePath -> [String] -> IO ()
runSetup verbosity ghc packageConf args = do
- rawSystemExit verbosity ghc ["-package-conf", packageConf,
- "--make", "Setup", "-o", "Setup"]
+ -- Don't bother building Setup if we are cleaning. If we need to
+ -- build Setup in order to build, and Setup isn't built already,
+ -- then there shouldn't be anything to clean anyway.
+ unless cleaning $
+ rawSystemExit verbosity ghc ["-package-conf", packageConf,
+ "--make", "Setup", "-o", "Setup"]
rawSystemExit verbosity "./Setup" args
+ where cleaning = case args of
+ "clean" : _ -> True
+ _ -> False