Commit 7cc66e7a authored by refold's avatar refold
Browse files

Move 'D.C.{PackageEnvironment, Index}' under 'D.C.Sandbox'.

They're only used by the sandbox code ATM.
parent 7c62cf27
......@@ -45,7 +45,7 @@ import Distribution.Client.Install ( InstallArgs,
makeInstallPlan,
processInstallPlan,
pruneInstallPlan )
import Distribution.Client.PackageEnvironment
import Distribution.Client.Sandbox.PackageEnvironment
( PackageEnvironment(..), IncludeComments(..), PackageEnvironmentType(..)
, createPackageEnvironment, classifyPackageEnvironment
, tryLoadPackageEnvironment, loadUserConfig
......@@ -70,8 +70,8 @@ import Distribution.Simple.Utils ( die, debug, notice, info
import Distribution.System ( Platform )
import Distribution.Verbosity ( Verbosity, lessVerbose )
import Distribution.Compat.Env ( lookupEnv, setEnv )
import qualified Distribution.Client.Index as Index
import qualified Distribution.Simple.Register as Register
import qualified Distribution.Client.Sandbox.Index as Index
import qualified Distribution.Simple.Register as Register
import Control.Exception ( assert, bracket_ )
import Control.Monad ( unless, when )
import Data.IORef ( newIORef, writeIORef, readIORef )
......
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Index
-- Module : Distribution.Client.Sandbox.Index
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
-- Querying and modifying local build tree references in the package index.
-----------------------------------------------------------------------------
module Distribution.Client.Index (
module Distribution.Client.Sandbox.Index (
createEmpty,
addBuildTreeRefs,
removeBuildTreeRefs,
......@@ -124,7 +124,7 @@ createEmpty verbosity path = do
-- | Add given local build tree references to the index.
addBuildTreeRefs :: Verbosity -> FilePath -> [FilePath] -> IO ()
addBuildTreeRefs _ _ [] =
error "Distribution.Client.Index.addBuildTreeRefs: unexpected"
error "Distribution.Client.Sandbox.Index.addBuildTreeRefs: unexpected"
addBuildTreeRefs verbosity path l' = do
checkIndexExists path
l <- liftM nub . mapM tryCanonicalizePath $ l'
......@@ -146,7 +146,7 @@ addBuildTreeRefs verbosity path l' = do
-- | Remove given local build tree references from the index.
removeBuildTreeRefs :: Verbosity -> FilePath -> [FilePath] -> IO ()
removeBuildTreeRefs _ _ [] =
error "Distribution.Client.Index.removeBuildTreeRefs: unexpected"
error "Distribution.Client.Sandbox.Index.removeBuildTreeRefs: unexpected"
removeBuildTreeRefs verbosity path l' = do
checkIndexExists path
l <- mapM tryCanonicalizePath l'
......
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.PackageEnvironment
-- Module : Distribution.Client.Sandbox.PackageEnvironment
-- Maintainer : cabal-devel@haskell.org
-- Portability : portable
--
......@@ -8,7 +8,7 @@
-- Distribution.Client.Config.
-----------------------------------------------------------------------------
module Distribution.Client.PackageEnvironment (
module Distribution.Client.Sandbox.PackageEnvironment (
PackageEnvironment(..)
, IncludeComments(..)
, PackageEnvironmentType(..)
......@@ -68,8 +68,8 @@ import qualified Distribution.Text as Text
-- * Configuration saved in the package environment file
--
-- TODO: would be nice to remove duplication between D.C.PackageEnvironment and
-- D.C.Config.
-- TODO: would be nice to remove duplication between
-- D.C.Sandbox.PackageEnvironment and D.C.Config.
data PackageEnvironment = PackageEnvironment {
-- The 'inherit' feature is not used ATM, but could be useful in the future
-- for constructing nested sandboxes (see discussion in #1196).
......
......@@ -64,7 +64,6 @@ import Distribution.Client.Upload as Upload (upload, check, report)
import Distribution.Client.Run (run)
import Distribution.Client.SrcDist (sdist)
import Distribution.Client.Get (get)
import Distribution.Client.PackageEnvironment (setPackageDB)
import Distribution.Client.Sandbox (sandboxInit
,sandboxAddSource
,sandboxDelete
......@@ -84,6 +83,8 @@ import Distribution.Client.Sandbox (sandboxInit
,configCompilerAux'
,configPackageDB')
import Distribution.Client.Sandbox.PackageEnvironment
(setPackageDB)
import Distribution.Client.Init (initCabal)
import qualified Distribution.Client.Win32SelfUpgrade as Win32SelfUpgrade
......
......@@ -75,7 +75,6 @@ executable cabal
Distribution.Client.GZipUtils
Distribution.Client.Haddock
Distribution.Client.HttpUtils
Distribution.Client.Index
Distribution.Client.IndexUtils
Distribution.Client.Init
Distribution.Client.Init.Heuristics
......@@ -86,12 +85,13 @@ executable cabal
Distribution.Client.InstallSymlink
Distribution.Client.JobControl
Distribution.Client.List
Distribution.Client.PackageEnvironment
Distribution.Client.PackageIndex
Distribution.Client.PackageUtils
Distribution.Client.ParseUtils
Distribution.Client.Run
Distribution.Client.Sandbox
Distribution.Client.Sandbox.Index
Distribution.Client.Sandbox.PackageEnvironment
Distribution.Client.Sandbox.Timestamp
Distribution.Client.Setup
Distribution.Client.SetupWrapper
......
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