Commit dff86f85 authored by Duncan Coutts's avatar Duncan Coutts

Move modules under Distribution.Client

And tidy some imports slightly
parent ad985376
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Check
-- Module : Distribution.Client.Check
-- Copyright : (c) Lennart Kolmodin 2008
-- License : BSD-like
--
......@@ -11,7 +11,7 @@
-- Check a package for common mistakes
--
-----------------------------------------------------------------------------
module Hackage.Check (
module Distribution.Client.Check (
check
) where
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Clean
-- Module : Distribution.Client.Clean
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,12 +10,12 @@
--
--
-----------------------------------------------------------------------------
module Hackage.Clean
module Distribution.Client.Clean
( clean
) where
import Hackage.Types (ConfigFlags(..))
import Hackage.Utils (fileNotFoundExceptions)
import Distribution.Client.Types (ConfigFlags(..))
import Distribution.Client.Utils (fileNotFoundExceptions)
import System.Directory (removeDirectoryRecursive)
import Control.Exception (catchJust)
......@@ -25,5 +25,5 @@ clean :: ConfigFlags -> IO ()
clean cfg
= catchJust fileNotFoundExceptions
(removeDirectoryRecursive (configCacheDir cfg))
-- The packages dir may not exist if it's already cleaned:
(const (return ()))
-- The packages dir may not exist if it's already cleaned:
(const (return ()))
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Config
-- Module : Distribution.Client.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 Hackage.Config
module Distribution.Client.Config
( SavedConfig(..)
, savedConfigToConfigFlags
, configRepos
......@@ -51,10 +51,10 @@ import Distribution.Verbosity (Verbosity, normal)
import Distribution.System
( OS(Windows), buildOS )
import Hackage.Types
import Distribution.Client.Types
( RemoteRepo(..), Repo(..), Username(..), Password(..) )
import Hackage.ParseUtils
import Hackage.Utils (readFileIfExists)
import Distribution.Client.ParseUtils
import Distribution.Client.Utils (readFileIfExists)
import Distribution.Simple.Utils (notice, warn)
configPackageDB :: Cabal.ConfigFlags -> PackageDB
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Dependency
-- Module : Distribution.Client.Dependency
-- Copyright : (c) David Himmelstrup 2005,
-- Bjorn Bringert 2007
-- Duncan Coutts 2008
......@@ -12,24 +12,24 @@
--
-- Top level interface to dependency resolution.
-----------------------------------------------------------------------------
module Hackage.Dependency (
module Distribution.Client.Dependency (
resolveDependencies,
resolveDependenciesWithProgress,
PackagesVersionPreference(..),
upgradableDependencies,
) where
--import Hackage.Dependency.Naive (naiveResolver)
import Hackage.Dependency.Bogus (bogusResolver)
import Hackage.Dependency.TopDown (topDownResolver)
--import Distribution.Client.Dependency.Naive (naiveResolver)
import Distribution.Client.Dependency.Bogus (bogusResolver)
import Distribution.Client.Dependency.TopDown (topDownResolver)
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.Simple.PackageIndex (PackageIndex)
import Distribution.InstalledPackageInfo (InstalledPackageInfo)
import qualified Hackage.InstallPlan as InstallPlan
import Hackage.InstallPlan (InstallPlan)
import Hackage.Types
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.Client.InstallPlan (InstallPlan)
import Distribution.Client.Types
( UnresolvedDependency(..), AvailablePackage(..) )
import Hackage.Dependency.Types
import Distribution.Client.Dependency.Types
( PackageName, DependencyResolver, PackageVersionPreference(..)
, Progress(..), foldProgress )
import Distribution.Package
......@@ -42,7 +42,7 @@ import Distribution.Compiler
import Distribution.System
( OS, Arch )
import Distribution.Simple.Utils (comparing)
import Hackage.Utils (mergeBy, MergeResult(..))
import Distribution.Client.Utils (mergeBy, MergeResult(..))
import Data.List (maximumBy)
import Data.Monoid (Monoid(mempty))
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Dependency.Bogus
-- Module : Distribution.Client.Dependency.Bogus
-- Copyright : (c) David Himmelstrup 2005, Bjorn Bringert 2007
-- Duncan Coutts 2008
-- License : BSD-like
......@@ -11,16 +11,16 @@
--
-- A dependency resolver for when we do not know what packages are installed.
-----------------------------------------------------------------------------
module Hackage.Dependency.Bogus (
module Distribution.Client.Dependency.Bogus (
bogusResolver
) where
import Hackage.Types
import Distribution.Client.Types
( UnresolvedDependency(..), AvailablePackage(..)
, ConfiguredPackage(..) )
import Hackage.Dependency.Types
import Distribution.Client.Dependency.Types
( DependencyResolver, Progress(..) )
import qualified Hackage.InstallPlan as InstallPlan
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.Package
( PackageIdentifier(..), Dependency(..), Package(..) )
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Dependency
-- Module : Distribution.Client.Dependency
-- Copyright : (c) David Himmelstrup 2005, Bjorn Bringert 2007,
-- Duncan Coutts 2008
-- License : BSD-like
......@@ -12,7 +12,7 @@
-- A dependency resolver that is not very sophisticated.
-- It often makes installation plans with inconsistent dependencies.
-----------------------------------------------------------------------------
module Hackage.Dependency.Naive (
module Distribution.Client.Dependency.Naive (
naiveResolver
) where
......@@ -20,11 +20,11 @@ import Distribution.InstalledPackageInfo (InstalledPackageInfo_(package))
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.Simple.PackageIndex (PackageIndex)
import Distribution.InstalledPackageInfo (InstalledPackageInfo)
import qualified Hackage.InstallPlan as InstallPlan
import Hackage.Types
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.Client.Types
( UnresolvedDependency(..), AvailablePackage(..)
, ConfiguredPackage(..) )
import Hackage.Dependency.Types
import Distribution.Client.Dependency.Types
( DependencyResolver, Progress(..) )
import Distribution.Package
( PackageIdentifier(..), Dependency(..), Package(..) )
......@@ -32,13 +32,13 @@ import Distribution.PackageDescription
( PackageDescription(buildDepends), GenericPackageDescription
, FlagAssignment )
import Distribution.PackageDescription.Configuration
( finalizePackageDescription)
( finalizePackageDescription)
import Distribution.Compiler
( CompilerId )
import Distribution.System
( OS, Arch )
import Distribution.Simple.Utils (comparing, intercalate)
import Hackage.Utils
import Distribution.Client.Utils
( showDependencies )
import Distribution.Text
( display )
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Dependency.Types
-- Module : Distribution.Client.Dependency.Types
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
......@@ -10,21 +10,21 @@
--
-- Common types for dependency resolution.
-----------------------------------------------------------------------------
module Hackage.Dependency.TopDown (
module Distribution.Client.Dependency.TopDown (
topDownResolver
) where
import Hackage.Dependency.TopDown.Types
import qualified Hackage.Dependency.TopDown.Constraints as Constraints
import Hackage.Dependency.TopDown.Constraints
import Distribution.Client.Dependency.TopDown.Types
import qualified Distribution.Client.Dependency.TopDown.Constraints as Constraints
import Distribution.Client.Dependency.TopDown.Constraints
( Satisfiable(..) )
import qualified Hackage.InstallPlan as InstallPlan
import Hackage.InstallPlan
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.Client.InstallPlan
( PlanPackage(..) )
import Hackage.Types
import Distribution.Client.Types
( UnresolvedDependency(..), AvailablePackage(..)
, ConfiguredPackage(..) )
import Hackage.Dependency.Types
import Distribution.Client.Dependency.Types
( PackageName, DependencyResolver, PackageVersionPreference(..)
, Progress(..), foldProgress )
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Dependency.TopDown.Constraints
-- Module : Distribution.Client.Dependency.TopDown.Constraints
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- A set of satisfiable dependencies (package version constraints).
-----------------------------------------------------------------------------
module Hackage.Dependency.TopDown.Constraints (
module Distribution.Client.Dependency.TopDown.Constraints (
Constraints,
empty,
choices,
......@@ -20,7 +20,7 @@ module Hackage.Dependency.TopDown.Constraints (
conflicting,
) where
import Hackage.Dependency.TopDown.Types
import Distribution.Client.Dependency.TopDown.Types
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.Simple.PackageIndex (PackageIndex)
import Distribution.Package
......@@ -30,7 +30,7 @@ import Distribution.Version
( withinRange )
import Distribution.Simple.Utils
( comparing )
import Hackage.Utils
import Distribution.Client.Utils
( mergeBy, MergeResult(..) )
import Data.List
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Dependency.TopDown.Types
-- Module : Distribution.Client.Dependency.TopDown.Types
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
......@@ -10,9 +10,9 @@
--
-- Types for the top-down dependency resolver.
-----------------------------------------------------------------------------
module Hackage.Dependency.TopDown.Types where
module Distribution.Client.Dependency.TopDown.Types where
import Hackage.Types
import Distribution.Client.Types
( AvailablePackage(..) )
import Distribution.InstalledPackageInfo (InstalledPackageInfo)
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Dependency.Types
-- Module : Distribution.Client.Dependency.Types
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- Common types for dependency resolution.
-----------------------------------------------------------------------------
module Hackage.Dependency.Types (
module Distribution.Client.Dependency.Types (
PackageName,
DependencyResolver,
PackageVersionPreference(..),
......@@ -18,9 +18,9 @@ module Hackage.Dependency.Types (
foldProgress,
) where
import Hackage.Types
import Distribution.Client.Types
( UnresolvedDependency(..), AvailablePackage(..) )
import qualified Hackage.InstallPlan as InstallPlan
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.InstalledPackageInfo
( InstalledPackageInfo )
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Fetch
-- Module : Distribution.Client.Fetch
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
--
-----------------------------------------------------------------------------
module Hackage.Fetch
module Distribution.Client.Fetch
(
-- * Commands
fetch
......@@ -24,15 +24,15 @@ import Network.URI
( URI(uriScheme, uriPath) )
import Network.HTTP (ConnError(..), Response(..))
import Hackage.Types
import Distribution.Client.Types
( UnresolvedDependency (..), AvailablePackage(..)
, AvailablePackageSource(..), Repo(..), repoURI )
import Hackage.Dependency
import Distribution.Client.Dependency
( resolveDependencies, PackagesVersionPreference(..) )
import Hackage.IndexUtils as IndexUtils
import Distribution.Client.IndexUtils as IndexUtils
( getAvailablePackages, disambiguateDependencies )
import qualified Hackage.InstallPlan as InstallPlan
import Hackage.HttpUtils (getHTTP)
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.Client.HttpUtils (getHTTP)
import Distribution.Package
( PackageIdentifier(..), Package(..) )
......
......@@ -2,7 +2,7 @@
-----------------------------------------------------------------------------
-- | Separate module for HTTP actions, using a proxy server if one exists
-----------------------------------------------------------------------------
module Hackage.HttpUtils (getHTTP, proxy) where
module Distribution.Client.HttpUtils (getHTTP, proxy) where
import Network.HTTP
( Request (..), Response (..), RequestMethod (..)
......@@ -10,8 +10,9 @@ import Network.HTTP
import Network.URI
( URI (..), URIAuth (..), parseAbsoluteURI )
import Network.Stream (Result)
import Network.Browser (Proxy (..), Authority (..), browse,
setOutHandler, setErrHandler, setProxy, request)
import Network.Browser
( Proxy (..), Authority (..), browse
, setOutHandler, setErrHandler, setProxy, request)
import Control.Monad
( mplus, join )
#ifdef WIN32
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.IndexUtils
-- Module : Distribution.Client.IndexUtils
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
......@@ -10,19 +10,20 @@
--
-- Extra utils related to the package indexes.
-----------------------------------------------------------------------------
module Hackage.IndexUtils (
module Distribution.Client.IndexUtils (
getAvailablePackages,
readRepoIndex,
disambiguatePackageName,
disambiguateDependencies
) where
import Hackage.Tar
import Hackage.Types
import Distribution.Client.Tar
import Distribution.Client.Types
( UnresolvedDependency(..), AvailablePackage(..)
, AvailablePackageSource(..), Repo(..) )
import Distribution.Package (PackageIdentifier(..), Package(..), Dependency(Dependency))
import Distribution.Package
( PackageIdentifier(..), Package(..), Dependency(Dependency) )
import Distribution.Simple.PackageIndex (PackageIndex)
import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.PackageDescription
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Info
-- Module : Distribution.Client.Info
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,14 +10,14 @@
--
-- High level interface to a dry-run package installation.
-----------------------------------------------------------------------------
module Hackage.Info (
module Distribution.Client.Info (
flattenResolvedDependencies,
infoPkg
) where
import Hackage.Fetch
import Hackage.Types
import Hackage.Utils (showDependencies)
import Distribution.Client.Fetch
import Distribution.Client.Types
import Distribution.Client.Utils (showDependencies)
import Distribution.Package
( Package(..) )
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Install
-- Module : Distribution.Client.Install
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- High level interface to package installation.
-----------------------------------------------------------------------------
module Hackage.Install (
module Distribution.Client.Install (
install,
upgrade,
) where
......@@ -25,28 +25,28 @@ import System.Directory
( getTemporaryDirectory, doesFileExist )
import System.FilePath ((</>),(<.>))
import Hackage.Dependency
import Distribution.Client.Dependency
( resolveDependenciesWithProgress, PackagesVersionPreference(..)
, upgradableDependencies )
import Hackage.Dependency.Types (Progress(..), foldProgress)
import Hackage.Fetch (fetchPackage)
-- import qualified Hackage.Info as Info
import Hackage.IndexUtils as IndexUtils
import Distribution.Client.Dependency.Types (Progress(..), foldProgress)
import Distribution.Client.Fetch (fetchPackage)
-- import qualified Distribution.Client.Info as Info
import Distribution.Client.IndexUtils as IndexUtils
( getAvailablePackages, disambiguateDependencies )
import qualified Hackage.InstallPlan as InstallPlan
import Hackage.InstallPlan (InstallPlan)
import Hackage.Setup
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.Client.InstallPlan (InstallPlan)
import Distribution.Client.Setup
( InstallFlags(..), configureCommand, filterConfigureFlags )
import Hackage.Tar (extractTarGzFile)
import Hackage.Types as Available
import Distribution.Client.Tar (extractTarGzFile)
import Distribution.Client.Types as Available
( UnresolvedDependency(..), AvailablePackage(..)
, AvailablePackageSource(..), Repo, ConfiguredPackage(..)
, BuildResult(..) )
import Hackage.SetupWrapper
import Distribution.Client.SetupWrapper
( setupWrapper, SetupScriptOptions(..), defaultSetupScriptOptions )
import Hackage.Reporting
import Distribution.Client.Reporting
( writeInstallPlanBuildReports )
import Hackage.Logging
import Distribution.Client.Logging
( writeInstallPlanBuildLog )
import Paths_cabal_install (getBinDir)
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.InstallPlan
-- Module : Distribution.Client.InstallPlan
-- Copyright : (c) Duncan Coutts 2008
-- License : BSD-like
--
......@@ -11,7 +11,7 @@
-- Package installation plan
--
-----------------------------------------------------------------------------
module Hackage.InstallPlan (
module Distribution.Client.InstallPlan (
InstallPlan,
ConfiguredPackage(..),
PlanPackage(..),
......@@ -44,7 +44,7 @@ module Hackage.InstallPlan (
configuredPackageProblems
) where
import Hackage.Types
import Distribution.Client.Types
( AvailablePackage(packageDescription), ConfiguredPackage(..) )
import Distribution.Package
( PackageIdentifier(..), Package(..), PackageFixedDeps(..)
......@@ -68,7 +68,7 @@ import Distribution.System
( OS, Arch )
import Distribution.Compiler
( CompilerId(..) )
import Hackage.Utils
import Distribution.Client.Utils
( duplicates, duplicatesBy, mergeBy, MergeResult(..) )
import Distribution.Simple.Utils
( comparing, intercalate )
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Install
-- Module : Distribution.Client.Install
-- Copyright : (c) David Himmelstrup 2005
-- License : BSD-like
--
......@@ -10,7 +10,7 @@
--
-- High level interface to package installation.
-----------------------------------------------------------------------------
module Hackage.List (
module Distribution.Client.List (
list
) where
......@@ -32,16 +32,16 @@ import qualified Distribution.Simple.PackageIndex as PackageIndex
import Distribution.Version (Version)
import Distribution.Verbosity (Verbosity)
import Hackage.IndexUtils (getAvailablePackages)
import Hackage.Setup (ListFlags(..))
import Hackage.Types (AvailablePackage(..), Repo)
import Distribution.Client.IndexUtils (getAvailablePackages)
import Distribution.Client.Setup (ListFlags(..))
import Distribution.Client.Types (AvailablePackage(..), Repo)
import Distribution.Simple.Configure (getInstalledPackages)
import Distribution.Simple.Compiler (Compiler,PackageDB)
import Distribution.Simple.Program (ProgramConfiguration)
import Distribution.Simple.Utils (equating, comparing, notice)
import Distribution.Simple.Setup (fromFlag)
import Hackage.Utils (mergeBy, MergeResult(..))
import Distribution.Client.Utils (mergeBy, MergeResult(..))
-- |Show information about packages
list :: Verbosity
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Logging
-- Module : Distribution.Client.Logging
-- Copyright : (c) David Waern 2008
-- License : BSD-like
--
......@@ -11,7 +11,7 @@
-- Build log data structure
--
-----------------------------------------------------------------------------
module Hackage.Logging (
module Distribution.Client.Logging (
BuildLogEntry(..),
InstallOutcome(..),
Outcome(..),
......@@ -31,18 +31,18 @@ module Hackage.Logging (
writeInstallPlanBuildLog
) where
import Hackage.Reporting
import Distribution.Client.Reporting
( InstallOutcome(..), Outcome(..) )
import Hackage.Types
import Distribution.Client.Types
( ConfiguredPackage(..), BuildResult )
import Hackage.Config
import Distribution.Client.Config
( defaultCabalDir )
import qualified Hackage.Types as BR
import qualified Distribution.Client.Types as BR
( BuildResult(..) )
import qualified Hackage.InstallPlan as InstallPlan
import Hackage.InstallPlan
import qualified Distribution.Client.InstallPlan as InstallPlan
import Distribution.Client.InstallPlan
( InstallPlan, PlanPackage )
import Hackage.ParseUtils
import Distribution.Client.ParseUtils
( showFields, parseBasicStanza )
import qualified Paths_cabal_install (version)
......
module Hackage.ParseUtils where
module Distribution.Client.ParseUtils where
import Distribution.Compat.ReadP
( ReadP, readP_to_S, pfail, get, look, choice, (+++) )
......
-----------------------------------------------------------------------------
-- |
-- Module : Hackage.Reporting
-- Module : Distribution.Client.Reporting
-- Copyright : (c) David Waern 2008
-- License : BSD-like
--
......@@ -11,7 +11,7 @@
-- Report data structure
--
-----------------------------------------------------------------------------
module Hackage.Reporting (
module Distribution.Client.Reporting (
BuildReport(..),
InstallOutcome(..),
Outcome(..),
......@@ -31,16 +31,16 @@ module Hackage.Reporting (