Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
5f159699
Commit
5f159699
authored
Oct 25, 2011
by
Andres Löh
Browse files
merging changes from HEAD into modular-solver branch
parent
f8ed7b55
Changes
2
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/IndexUtils.hs
View file @
5f159699
...
...
@@ -85,35 +85,9 @@ getInstalledPackages verbosity comp packageDbs conf =
--FIXME: make getInstalledPackages use sensible verbosity in the first place
verbosity'
=
lessVerbose
verbosity
convert
::
InstalledPackageIndex
.
PackageIndex
->
PackageIndex
InstalledPackage
convert
index
=
PackageIndex
.
fromList
-- There can be multiple installed instances of each package version,
-- like when the same package is installed in the global & user dbs.
-- InstalledPackageIndex.allPackagesByName gives us the installed
-- packages with the most preferred instances first, so by picking the
-- first we should get the user one. This is almost but not quite the
-- same as what ghc does.
[
InstalledPackage
ipkg
(
sourceDeps
index
ipkg
)
|
ipkgs
<-
InstalledPackageIndex
.
allPackagesByName
index
,
(
ipkg
:
_
)
<-
groupBy
(
equating
packageVersion
)
ipkgs
]
-- The InstalledPackageInfo only lists dependencies by the
-- InstalledPackageId, which means we do not directly know the corresponding
-- source dependency. The only way to find out is to lookup the
-- InstalledPackageId to get the InstalledPackageInfo and look at its
-- source PackageId. But if the package is broken because it depends on
-- other packages that do not exist then we have a problem we cannot find
-- the original source package id. Instead we make up a bogus package id.
-- This should have the same effect since it should be a dependency on a
-- non-existant package.
sourceDeps
index
ipkg
=
[
maybe
(
brokenPackageId
depid
)
packageId
mdep
|
let
depids
=
InstalledPackageInfo
.
depends
ipkg
getpkg
=
InstalledPackageIndex
.
lookupInstalledPackageId
index
,
(
depid
,
mdep
)
<-
zip
depids
(
map
getpkg
depids
)
]
brokenPackageId
(
InstalledPackageId
str
)
=
PackageIdentifier
(
PackageName
(
str
++
"-broken"
))
(
Version
[]
[]
)
------------------------------------------------------------------------
-- Reading the source package index
--
-- | Read a repository index from disk, from the local files specified by
-- a list of 'Repo's.
...
...
cabal-install/Distribution/Client/Setup.hs
View file @
5f159699
...
...
@@ -612,7 +612,10 @@ defaultInstallFlags = InstallFlags {
where
docIndexFile
=
toPathTemplate
(
"$datadir"
</>
"doc"
</>
"index.html"
)
installCommand
::
CommandUI
(
ConfigFlags
,
ConfigExFlags
,
InstallFlags
)
defaultMaxBackjumps
::
Int
defaultMaxBackjumps
=
200
installCommand
::
CommandUI
(
ConfigFlags
,
ConfigExFlags
,
InstallFlags
,
HaddockFlags
)
installCommand
=
CommandUI
{
commandName
=
"install"
,
commandSynopsis
=
"Installs a list of packages."
,
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment