Commit 0f959a1f authored by bjorn@bringert.net's avatar bjorn@bringert.net
Browse files

Removed the build-dep command. It has been been broken since we started to use...

Removed the build-dep command. It has been been broken since we started to use configurations, and should be subsumed by the planned cabal-setup integration.
parent c39a0f9c
......@@ -23,7 +23,6 @@ Main-Is: CabalInstall.hs
Hs-Source-Dirs: src
Ghc-Options: -Wall
Other-Modules:
Network.Hackage.CabalInstall.BuildDep
Network.Hackage.CabalInstall.Clean
Network.Hackage.CabalInstall.Config
Network.Hackage.CabalInstall.Dependency
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.CabalInstall.BuildDep
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
-- Maintainer : lemmih@gmail.com
-- Stability : provisional
-- Portability : portable
--
-- High level interface to a specialized instance of package installation.
-----------------------------------------------------------------------------
module Network.Hackage.CabalInstall.BuildDep where
import Network.Hackage.CabalInstall.Config (findCompiler, getKnownPackages, listInstalledPackages)
import Network.Hackage.CabalInstall.Dependency (getPackages, getBuildDeps
, depToUnresolvedDep, resolveDependenciesAux)
import Network.Hackage.CabalInstall.Install (install, installPackages)
import Network.Hackage.CabalInstall.Types (ConfigFlags (..), UnresolvedDependency)
import Distribution.PackageDescription (readPackageDescription, buildDepends,
GenericPackageDescription(..))
{-|
This function behaves exactly like 'Network.Hackage.CabalInstall.Install.install' except
that it only builds the dependencies for packages.
-}
buildDep :: ConfigFlags -> [String] -> [UnresolvedDependency] -> IO ()
buildDep cfg globalArgs deps
= do (comp,conf) <- findCompiler cfg
ipkgs <- listInstalledPackages cfg comp conf
available <- getKnownPackages cfg
let apkgs = getPackages $ getBuildDeps ipkgs $
resolveDependenciesAux cfg comp conf ipkgs available deps
installPackages cfg comp globalArgs apkgs
-- | Takes the path to a .cabal file, and installs the build-dependencies listed there.
-- FIXME: what if the package uses hooks which modify the build-dependencies?
buildDepLocalPkg :: ConfigFlags -> FilePath -> IO ()
buildDepLocalPkg cfg pkgDescPath =
do pkgDesc <- readPackageDescription (configVerbose cfg) pkgDescPath
let deps = map depToUnresolvedDep $ buildDepends $ packageDescription pkgDesc
install cfg [] deps
......@@ -24,7 +24,6 @@ import Network.Hackage.CabalInstall.Info (info)
import Network.Hackage.CabalInstall.Update (update)
import Network.Hackage.CabalInstall.Fetch (fetch)
import Network.Hackage.CabalInstall.Clean (clean)
import Network.Hackage.CabalInstall.BuildDep (buildDep, buildDepLocalPkg)
main :: IO ()
......@@ -39,9 +38,6 @@ main = do args <- getArgs
f config globalArgs pkgs
case action of
InstallCmd -> runCmd install
BuildDepCmd -> case args of
[file] | ".cabal" `isSuffixOf` file -> buildDepLocalPkg config file
_ -> runCmd buildDep
InfoCmd -> runCmd info
ListCmd -> list config args
UpdateCmd -> update config
......
......@@ -108,7 +108,7 @@ data Cmd = Cmd {
}
commandList :: [Cmd]
commandList = [fetchCmd, installCmd, buildDepCmd, updateCmd, cleanCmd, listCmd, infoCmd]
commandList = [fetchCmd, installCmd, updateCmd, cleanCmd, listCmd, infoCmd]
lookupCommand :: String -> Maybe Cmd
lookupCommand name = find ((==name) . cmdName) commandList
......@@ -176,9 +176,6 @@ installCmd = mkCmd "install" "Installs a list of packages." "" InstallCmd
listCmd :: Cmd
listCmd = mkCmd "list" "List available packages on the server." "" ListCmd
buildDepCmd :: Cmd
buildDepCmd = mkCmd "build-dep" "Installs the dependencies for a list of packages or for a .cabal file." "" BuildDepCmd
updateCmd :: Cmd
updateCmd = mkCmd "update" "Updates list of known packages" "" UpdateCmd
......
......@@ -29,7 +29,6 @@ data PkgInfo = PkgInfo {
data Action
= FetchCmd
| InstallCmd
| BuildDepCmd
| CleanCmd
| UpdateCmd
| InfoCmd
......
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