Commit 87069e2a authored by nominolo@gmail.com's avatar nominolo@gmail.com
Browse files

Rename 'PreparedPackageDescription' to 'GenericPackageDescription'

parent eb18e765
......@@ -43,7 +43,7 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. -}
module Distribution.PackageDescription (
-- * Package descriptions
PackageDescription(..),
PreparedPackageDescription(..),
GenericPackageDescription(..),
finalizePackageDescription,
emptyPackageDescription,
readPackageDescription,
......@@ -198,8 +198,8 @@ emptyPackageDescription
extraTmpFiles = []
}
data PreparedPackageDescription =
PreparedPackageDescription {
data GenericPackageDescription =
GenericPackageDescription {
packageDescription :: PackageDescription,
packageFlags :: [Flag],
condLibrary :: Maybe (CondTree ConfVar Dependency Library),
......@@ -208,8 +208,8 @@ data PreparedPackageDescription =
--deriving (Show)
-- XXX: I think we really want a PPrint or Pretty or ShowPretty class.
instance Show PreparedPackageDescription where
show (PreparedPackageDescription pkg flgs mlib exes) =
instance Show GenericPackageDescription where
show (GenericPackageDescription pkg flgs mlib exes) =
showPackageDescription pkg ++ "\n" ++
(render $ vcat $ map ppFlag flgs) ++ "\n" ++
render (maybe empty (\l -> text "Library:" $+$
......@@ -229,11 +229,11 @@ instance Show PreparedPackageDescription where
finalizePackageDescription :: [(String,Bool)] -> Maybe [PackageIdentifier]
-> String -> String
-> PreparedPackageDescription
-> GenericPackageDescription
-> Either [Dependency]
(PackageDescription, [(String,Bool)])
finalizePackageDescription userflags mpkgs os arch
(PreparedPackageDescription pkg flags mlib0 exes) =
(GenericPackageDescription pkg flags mlib0 exes) =
case resolveFlags mlib0 of
Right (mlib, deps, flagVals) ->
let exes' = finalizeExes flagVals in
......@@ -726,7 +726,7 @@ readHookedBuildInfo verbosity = readAndParseFile verbosity parseHookedBuildInfo
-- |Parse the given package file.
-- readPackageDescription :: Int -> FilePath -> IO PackageDescription
-- readPackageDescription verbosity = readAndParseFile verbosity parseDescription
readPackageDescription :: Verbosity -> FilePath -> IO PreparedPackageDescription
readPackageDescription :: Verbosity -> FilePath -> IO GenericPackageDescription
readPackageDescription verbosity =
readAndParseFile verbosity (\s -> readFields s >>= parseDescription')
{-
......@@ -860,7 +860,7 @@ skipField :: PM ()
skipField = modify tail
-- | Parses the pre-parsed list of fields into a prepared package description.
parseDescription' :: [Field] -> ParseResult PreparedPackageDescription
parseDescription' :: [Field] -> ParseResult GenericPackageDescription
parseDescription' fields0 = do
let sf = sectionizeFields fields0
fields <- mapSimpleFields deprecField sf
......@@ -870,7 +870,7 @@ parseDescription' fields0 = do
pkg <- lift $ parseFields pkgDescrFieldDescrs emptyPackageDescription hfs
(flags, mlib, exes) <- getBody
warnIfRest
return (PreparedPackageDescription pkg flags mlib exes)
return (GenericPackageDescription pkg flags mlib exes)
where
-- "Sectionize" an old-style Cabal file. A sectionized file has:
......
......@@ -143,7 +143,7 @@ data UserHooks = UserHooks
-- |Hook to run before configure command
preConf :: Args -> ConfigFlags -> IO HookedBuildInfo,
-- |Over-ride this hook to get different behavior during configure.
confHook :: ( Either PreparedPackageDescription PackageDescription
confHook :: ( Either GenericPackageDescription PackageDescription
, HookedBuildInfo)
-> ConfigFlags -> IO (LocalBuildInfo, PackageDescription),
-- |Hook to run after configure command
......@@ -329,7 +329,7 @@ defaultMainWorker mdescr action all_args hooks prog_conf
postConf hooks args flags' pkg_descr localbuildinfo
where
confPkgDescr :: ConfigFlags -> IO (Either PreparedPackageDescription
confPkgDescr :: ConfigFlags -> IO (Either GenericPackageDescription
PackageDescription)
confPkgDescr cfgflags = do
mdescr' <- readDesc hooks
......
......@@ -78,7 +78,7 @@ import Distribution.Package (PackageIdentifier(..), showPackageId,
parsePackageId)
import Distribution.PackageDescription(
PackageDescription(..), Library(..),
PreparedPackageDescription(..),
GenericPackageDescription(..),
finalizePackageDescription,
HookedBuildInfo, sanityCheckPackage, updatePackageDescription,
BuildInfo(..), Executable(..), setupMessage,
......@@ -177,7 +177,7 @@ getConfiguredPkgDescr = tryGetConfiguredPkgDescr >>= either die return
-- |Perform the \"@.\/setup configure@\" action.
-- Returns the @.setup-config@ file.
configure :: ( Either PreparedPackageDescription PackageDescription
configure :: ( Either GenericPackageDescription PackageDescription
, HookedBuildInfo)
-> ConfigFlags -> IO (LocalBuildInfo, PackageDescription)
configure (pkg_descr0, pbi) cfg
......
Supports Markdown
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