Repository : ssh://darcs.haskell.org//srv/darcs/packages/Cabal

On branch  : master

http://hackage.haskell.org/trac/ghc/changeset/33809c5db7e396f1bd92a70508e81d1d384fee0a

>---------------------------------------------------------------

commit 33809c5db7e396f1bd92a70508e81d1d384fee0a
Author: Duncan Coutts <[email protected]>
Date:   Wed May 7 15:57:25 2008 +0000

    Move ConfiguredPackage type into Types module
    It's not actually specific to the InstallPlan.

>---------------------------------------------------------------

 cabal-install/Hackage/Install.hs     |    2 +-
 cabal-install/Hackage/InstallPlan.hs |   22 ++--------------------
 cabal-install/Hackage/Types.hs       |   22 +++++++++++++++++++++-
 3 files changed, 24 insertions(+), 22 deletions(-)

diff --git a/cabal-install/Hackage/Install.hs b/cabal-install/Hackage/Install.hs
index 2895cc9..30420ca 100644
--- a/cabal-install/Hackage/Install.hs
+++ b/cabal-install/Hackage/Install.hs
@@ -32,7 +32,7 @@ import Hackage.Setup (InstallFlags(..))
 import Hackage.Tar (extractTarGzFile)
 import Hackage.Types as Available
          ( UnresolvedDependency(..), AvailablePackage(..)
-         , AvailablePackageSource(..), Repo )
+         , AvailablePackageSource(..), Repo, ConfiguredPackage(..) )
 import Hackage.Utils (showDependencies)
 import Hackage.SetupWrapper
          ( setupWrapper, SetupScriptOptions(..) )
diff --git a/cabal-install/Hackage/InstallPlan.hs 
b/cabal-install/Hackage/InstallPlan.hs
index d49e4c0..31b2d55 100644
--- a/cabal-install/Hackage/InstallPlan.hs
+++ b/cabal-install/Hackage/InstallPlan.hs
@@ -41,7 +41,7 @@ module Hackage.InstallPlan (
   ) where
 
 import Hackage.Types
-         ( AvailablePackage(packageDescription) )
+         ( AvailablePackage(packageDescription), ConfiguredPackage(..) )
 import Distribution.Package
          ( PackageIdentifier(..), Package(..), PackageFixedDeps(..)
          , packageName, Dependency(..) )
@@ -52,7 +52,7 @@ import Distribution.InstalledPackageInfo
 import Distribution.PackageDescription
          ( GenericPackageDescription(genPackageFlags)
          , PackageDescription(buildDepends)
-         , Flag(flagName), FlagName(..), FlagAssignment )
+         , Flag(flagName), FlagName(..) )
 import Distribution.PackageDescription.Configuration
          ( finalizePackageDescription )
 import Distribution.Simple.PackageIndex
@@ -114,24 +114,6 @@ import Control.Exception
 -- also in the set. It is consistent if for every package in the set, all
 -- dependencies which target that package have the same version.
 
--- | A 'ConfiguredPackage' is a not-yet-installed package along with the
--- total configuration information. The configuration information is total in
--- the sense that it provides all the configuration information and so the
--- final configure process will be independent of the environment.

>---------------------------------------------------------------

-data ConfiguredPackage = ConfiguredPackage
-       AvailablePackage    -- ^ package info, including repo
-       FlagAssignment      -- ^ complete flag assignment for the package
-       [PackageIdentifier] -- ^ exact dependencies, must be consistent with the
-                           -- version constraints in the package info
-  deriving Show
-
-instance Package ConfiguredPackage where
-  packageId (ConfiguredPackage pkg _ _) = packageId pkg
-
-instance PackageFixedDeps ConfiguredPackage where
-  depends (ConfiguredPackage _ _ deps) = deps
-
 data PlanPackage buildResult = PreExisting InstalledPackageInfo
                              | Configured  ConfiguredPackage
                              | Installed   ConfiguredPackage
diff --git a/cabal-install/Hackage/Types.hs b/cabal-install/Hackage/Types.hs
index 672b40c..645e82a 100644
--- a/cabal-install/Hackage/Types.hs
+++ b/cabal-install/Hackage/Types.hs
@@ -13,13 +13,33 @@
 module Hackage.Types where
 
 import Distribution.Package
-         ( PackageIdentifier(..), Package(..), Dependency )
+         ( PackageIdentifier(..), Package(..), PackageFixedDeps(..)
+         , Dependency )
 import Distribution.PackageDescription
          ( GenericPackageDescription, FlagAssignment )
 
 newtype Username = Username { unUsername :: String }
 newtype Password = Password { unPassword :: String }
 
+-- | A 'ConfiguredPackage' is a not-yet-installed package along with the
+-- total configuration information. The configuration information is total in
+-- the sense that it provides all the configuration information and so the
+-- final configure process will be independent of the environment.
+--
+data ConfiguredPackage = ConfiguredPackage
+       AvailablePackage    -- ^ package info, including repo
+       FlagAssignment      -- ^ complete flag assignment for the package
+       [PackageIdentifier] -- ^ exact dependencies, must be consistent with the
+                           -- version constraints in the package info
+  deriving Show
+
+instance Package ConfiguredPackage where
+  packageId (ConfiguredPackage pkg _ _) = packageId pkg
+
+instance PackageFixedDeps ConfiguredPackage where
+  depends (ConfiguredPackage _ _ deps) = deps
+
+
 -- | We re-use @GenericPackageDescription@ and use the @package-url@
 -- field to store the tarball URL.
 data AvailablePackage = AvailablePackage {



_______________________________________________
Cvs-libraries mailing list
[email protected]
http://www.haskell.org/mailman/listinfo/cvs-libraries

Reply via email to