Commit 68759b73 authored by Don Stewart's avatar Don Stewart
Browse files

Flatten cabal install namespace!

parent 44b01d0c
--------------------------------------------------------------------
-- |
-- Module : Cabal
-- Copyright : (c)
-- License : BSD3
--
-- Maintainer: cabal-devel@haskell.org
-- Stability : provisional
-- Portability:
--
--------------------------------------------------------------------
module Main where
import qualified Network.Hackage.Cabal.Main as Cabal
main :: IO ()
main = Cabal.main
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Clean
-- Module : Hackage.Clean
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,11 +10,11 @@
--
--
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Clean
module Hackage.Clean
( clean
) where
import Network.Hackage.Cabal.Types (ConfigFlags(..))
import Hackage.Types (ConfigFlags(..))
import System.Directory (removeDirectoryRecursive)
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Config
-- Module : Hackage.Config
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- Utilities for handling saved state such as known packages, known servers and downloaded packages.
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Config
module Hackage.Config
( repoCacheDir
, packageFile
, packageDir
......@@ -52,9 +52,9 @@ import Distribution.Simple.Program (ProgramConfiguration, defaultProgramConfigur
import Distribution.Version (Dependency, showVersion)
import Distribution.Verbosity (Verbosity, normal)
import Network.Hackage.Cabal.Tar (readTarArchive, tarFileName)
import Network.Hackage.Cabal.Types (ConfigFlags (..), PkgInfo (..), Repo(..))
import Network.Hackage.Cabal.Utils
import Hackage.Tar (readTarArchive, tarFileName)
import Hackage.Types (ConfigFlags (..), PkgInfo (..), Repo(..))
import Hackage.Utils
-- | Full path to the local cache directory for a repository.
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Dependency
-- Module : Hackage.Dependency
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- Various kinds of dependency resolution and utilities.
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Dependency
module Hackage.Dependency
(
-- * Dependency resolution
resolveDependencies
......@@ -36,8 +36,8 @@ import Data.Char (toLower)
import Data.List (nub, maximumBy, isPrefixOf)
import qualified System.Info (arch,os)
import Network.Hackage.Cabal.Config (listInstalledPackages, getKnownPackages, findCompiler)
import Network.Hackage.Cabal.Types ( ResolvedPackage(..), UnresolvedDependency(..)
import Hackage.Config (listInstalledPackages, getKnownPackages, findCompiler)
import Hackage.Types ( ResolvedPackage(..), UnresolvedDependency(..)
, ConfigFlags (..), PkgInfo (..), ResolvedDependency(..), Repo(..))
import Text.Printf (printf)
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Fetch
-- Module : Hackage.Fetch
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
--
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Fetch
module Hackage.Fetch
(
-- * Commands
fetch
......@@ -31,9 +31,9 @@ import Control.Monad (filterM)
import Text.Printf (printf)
import System.Directory (doesFileExist, createDirectoryIfMissing)
import Network.Hackage.Cabal.Types (ConfigFlags (..), UnresolvedDependency (..), Repo(..))
import Network.Hackage.Cabal.Config (repoCacheDir, packageFile, packageDir, pkgURL, message, findCompiler)
import Network.Hackage.Cabal.Dependency (filterFetchables, resolveDependencies)
import Hackage.Types (ConfigFlags (..), UnresolvedDependency (..), Repo(..))
import Hackage.Config (repoCacheDir, packageFile, packageDir, pkgURL, message, findCompiler)
import Hackage.Dependency (filterFetchables, resolveDependencies)
import Distribution.Package (PackageIdentifier(..), showPackageId)
import Distribution.Verbosity
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Info
-- Module : Hackage.Info
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,13 +10,13 @@
--
-- High level interface to a dry-run package installation.
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Info where
module Hackage.Info where
import Network.Hackage.Cabal.Config (pkgURL, findCompiler, listInstalledPackages)
import Network.Hackage.Cabal.Dependency
import Hackage.Config (pkgURL, findCompiler, listInstalledPackages)
import Hackage.Dependency
(resolveDependencies, fulfillDependency)
import Network.Hackage.Cabal.Fetch (isFetched, packageFile)
import Network.Hackage.Cabal.Types (ConfigFlags(..), ResolvedPackage(..)
import Hackage.Fetch (isFetched, packageFile)
import Hackage.Types (ConfigFlags(..), ResolvedPackage(..)
,UnresolvedDependency(..))
import Distribution.Package (PackageIdentifier, showPackageId)
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Install
-- Module : Hackage.Install
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- High level interface to package installation.
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Install
module Hackage.Install
( install -- :: ConfigFlags -> [UnresolvedDependency] -> IO ()
, installPackages
, installPkg -- :: ConfigFlags -> (PackageIdentifier,[String],String) -> IO ()
......@@ -25,11 +25,11 @@ import System.FilePath ((</>),(<.>))
import Text.Printf (printf)
import Network.Hackage.Cabal.Config (findCompiler, message)
import Network.Hackage.Cabal.Dependency (getPackages, resolveDependencies)
import Network.Hackage.Cabal.Fetch (isFetched, packageFile, fetchPackage)
import Network.Hackage.Cabal.Tar (extractTarGzFile)
import Network.Hackage.Cabal.Types (ConfigFlags(..), UnresolvedDependency(..)
import Hackage.Config (findCompiler, message)
import Hackage.Dependency (getPackages, resolveDependencies)
import Hackage.Fetch (isFetched, packageFile, fetchPackage)
import Hackage.Tar (extractTarGzFile)
import Hackage.Types (ConfigFlags(..), UnresolvedDependency(..)
, Repo(..))
import Distribution.Simple.Compiler (Compiler(..))
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Install
-- Module : Hackage.Install
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- High level interface to package installation.
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.List
module Hackage.List
( list -- :: ConfigFlags -> [UnresolvedDependency] -> IO ()
) where
......@@ -21,8 +21,8 @@ import Data.Char as Char (toLower)
import Data.Ord (comparing)
import Distribution.Package
import Distribution.PackageDescription
import Network.Hackage.Cabal.Config (getKnownPackages)
import Network.Hackage.Cabal.Types (PkgInfo(..), ConfigFlags(..), UnresolvedDependency(..))
import Hackage.Config (getKnownPackages)
import Hackage.Types (PkgInfo(..), ConfigFlags(..), UnresolvedDependency(..))
-- |Show information about packages
list :: ConfigFlags -> [String] -> IO ()
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Setup
-- Module : Hackage.Setup
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
--
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Setup
module Hackage.Setup
( parsePackageArgs
, parseGlobalArgs
, configFromOptions
......@@ -26,9 +26,9 @@ import System.Console.GetOpt (ArgDescr (..), ArgOrder (..), OptDescr (..), usage
import System.Exit (exitWith, ExitCode (..))
import System.Environment (getProgName)
import Network.Hackage.Cabal.Types (Action (..), Option(..), ConfigFlags(..)
import Hackage.Types (Action (..), Option(..), ConfigFlags(..)
, UnresolvedDependency (..))
import Network.Hackage.Cabal.Utils (readPToMaybe)
import Hackage.Utils (readPToMaybe)
globalOptions :: [OptDescr Option]
......
-- | Simplistic TAR archive reading. Only gets the file names and file contents.
module Network.Hackage.Cabal.Tar (TarHeader(..), TarFileType(..),
module Hackage.Tar (TarHeader(..), TarFileType(..),
readTarArchive, extractTarArchive,
extractTarGzFile, gunzip) where
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Types
-- Module : Hackage.Types
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- All data types for the entire cabal-install system gathered here to avoid some .hs-boot files.
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Types where
module Hackage.Types where
import Distribution.Simple.Compiler (CompilerFlavor)
import Distribution.Simple.InstallDirs (InstallDirTemplates)
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Update
-- Module : Hackage.Update
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,13 +10,13 @@
--
--
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Update
module Hackage.Update
( update
) where
import Network.Hackage.Cabal.Types (ConfigFlags (..), PkgInfo(..), Repo(..))
import Network.Hackage.Cabal.Fetch (downloadIndex)
import Network.Hackage.Cabal.Tar (gunzip)
import Hackage.Types (ConfigFlags (..), PkgInfo(..), Repo(..))
import Hackage.Fetch (downloadIndex)
import Hackage.Tar (gunzip)
import qualified Data.ByteString.Lazy.Char8 as BS
......
module Network.Hackage.Cabal.Utils where
module Hackage.Utils where
import Distribution.Compat.ReadP (ReadP, readP_to_S, pfail, get, look, choice)
import Distribution.ParseUtils
......
module Network.Hackage.Version where
module Hackage.Version where
import Data.Version
import Paths_cabal_install (version)
......
-----------------------------------------------------------------------------
-- |
-- Module : Network.Hackage.Cabal.Main
-- Module : Main
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,20 +10,20 @@
--
-- Entry point to the default cabal-install front-end.
-----------------------------------------------------------------------------
module Network.Hackage.Cabal.Main where
module Main where
import Data.List (isSuffixOf)
import System.Environment (getArgs)
import Network.Hackage.Cabal.Types (Action (..), Option(..))
import Network.Hackage.Cabal.Setup (parseGlobalArgs, parsePackageArgs, configFromOptions)
import Network.Hackage.Cabal.Config (defaultConfigFile, loadConfig)
import Hackage.Types (Action (..), Option(..))
import Hackage.Setup (parseGlobalArgs, parsePackageArgs, configFromOptions)
import Hackage.Config (defaultConfigFile, loadConfig)
import Network.Hackage.Cabal.List (list)
import Network.Hackage.Cabal.Install (install)
import Network.Hackage.Cabal.Info (info)
import Network.Hackage.Cabal.Update (update)
import Network.Hackage.Cabal.Fetch (fetch)
import Network.Hackage.Cabal.Clean (clean)
import Hackage.List (list)
import Hackage.Install (install)
import Hackage.Info (info)
import Hackage.Update (update)
import Hackage.Fetch (fetch)
import Hackage.Clean (clean)
main :: IO ()
......
......@@ -20,23 +20,22 @@ flag old-base
description: Old, monolithic base
Executable cabal
Main-Is: Cabal.hs
Main-Is: Main.hs
Ghc-Options: -Wall
Other-Modules:
Network.Hackage.Cabal.Clean
Network.Hackage.Cabal.Config
Network.Hackage.Cabal.Dependency
Network.Hackage.Cabal.Fetch
Network.Hackage.Cabal.Info
Network.Hackage.Cabal.Install
Network.Hackage.Cabal.List
Network.Hackage.Cabal.Main
Network.Hackage.Cabal.Setup
Network.Hackage.Cabal.Tar
Network.Hackage.Cabal.Types
Network.Hackage.Cabal.Update
Network.Hackage.Cabal.Utils
Network.Hackage.Version
Hackage.Clean
Hackage.Config
Hackage.Dependency
Hackage.Fetch
Hackage.Info
Hackage.Install
Hackage.List
Hackage.Setup
Hackage.Tar
Hackage.Types
Hackage.Update
Hackage.Utils
Hackage.Version
build-depends: mtl, network, regex-compat, unix, Cabal>=1.3,
zlib >= 0.4, HTTP >= 3000.0 && < 3000.1, filepath >= 1.0
......
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