Remove redundant libraries/cabal-bin.hs
authorIan Lynagh <igloo@earth.li>
Sun, 16 Jan 2011 19:49:19 +0000 (19:49 +0000)
committerIan Lynagh <igloo@earth.li>
Sun, 16 Jan 2011 19:49:19 +0000 (19:49 +0000)
.darcs-boring
libraries/cabal-bin.hs [deleted file]

index 681ab0c..a1a6445 100644 (file)
@@ -91,7 +91,6 @@
 # Other library bits that get generated:
 ^libraries/bootstrapping/
 ^libraries/stamp/
-^libraries/cabal-bin$
 ^libraries/ifBuildable(/|$)
 ^libraries/installPackage(/|$)
 ^libraries/index.html
diff --git a/libraries/cabal-bin.hs b/libraries/cabal-bin.hs
deleted file mode 100644 (file)
index 664480f..0000000
+++ /dev/null
@@ -1,62 +0,0 @@
-
-module Main (main) where
-
-import Control.Monad
-import Data.Maybe
-import Distribution.PackageDescription
-import Distribution.PackageDescription.Parse
-import Distribution.Simple
-import Distribution.Simple.Utils
-import Distribution.Verbosity
-import System.Directory
-import System.Environment
-import System.FilePath
-
-import qualified Distribution.Make   as Make
-import qualified Distribution.Simple as Simple
-
-setupProg :: FilePath
-setupProg = "./Setup"
-
-main :: IO ()
-main = do
-    unprocessedArgs <- getArgs
-    let verbosity = verbose
-    case unprocessedArgs of
-        ghc : packageConf : useCabalVersion : args ->
-            doit verbosity ghc packageConf useCabalVersion args
-        _ -> die "Bad args"
-
-doit :: Verbosity -> FilePath -> FilePath -> String -> [String] -> IO ()
-doit verbosity ghc packageConf useCabalVersion args = do
-    exists <- doesFileExist setupProg
-    if exists then rawSystemExit verbosity setupProg args
-              else do
-        gpdFile <- defaultPackageDesc verbosity
-        gpd <- readPackageDescription verbosity gpdFile
-        let pd = packageDescription gpd
-        case buildType pd of
-            Just Simple    -> Simple.defaultMainArgs                     args
-            Just Make      -> Make.defaultMainArgs                       args
-            Just Configure -> defaultMainWithHooksArgs autoconfUserHooks args
-            _ | packageName pd == PackageName "Cabal" ->
-                              -- Cabal is special...*sigh*
-                              Simple.defaultMainArgs                     args
-              | otherwise  ->
-                runSetup verbosity ghc packageConf useCabalVersion args
-
-runSetup :: Verbosity -> FilePath -> FilePath -> String -> [String] -> IO ()
-runSetup verbosity ghc packageConf useCabalVersion args = do
-    -- 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",
-                                     "-package", "Cabal-" ++ useCabalVersion,
-                                     "-o", "Setup"]
-    rawSystemExit verbosity "./Setup" args
-  where cleaning = case args of
-                   "clean" : _ -> True
-                   _ -> False
-