Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Glasgow Haskell Compiler
Packages
Cabal
Commits
11ea2294
Commit
11ea2294
authored
Jul 23, 2016
by
bardur.arantsson
Committed by
GitHub
Jul 23, 2016
Browse files
Merge pull request #3601 from BardurArantsson/remove-dead-code
Remove dead code
parents
165b6a05
03a50e74
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/Dependency.hs
View file @
11ea2294
...
...
@@ -23,11 +23,9 @@ module Distribution.Client.Dependency (
resolveWithoutDependencies
,
-- * Constructing resolver policies
DepResolverParams
(
..
),
PackageConstraint
(
..
),
PackagesPreferenceDefault
(
..
),
PackagePreference
(
..
),
InstalledPreference
(
..
),
-- ** Standard policy
basicInstallPolicy
,
...
...
@@ -38,8 +36,6 @@ module Distribution.Client.Dependency (
applySandboxInstallPolicy
,
-- ** Extra policy options
dontUpgradeNonUpgradeablePackages
,
hideBrokenInstalledPackages
,
upgradeDependencies
,
reinstallTargets
,
...
...
@@ -56,10 +52,6 @@ module Distribution.Client.Dependency (
setMaxBackjumps
,
setEnableBackjumping
,
setGoalOrder
,
addSourcePackages
,
hideInstalledPackagesSpecificByUnitId
,
hideInstalledPackagesSpecificBySourcePackageId
,
hideInstalledPackagesAllVersions
,
removeLowerBounds
,
removeUpperBounds
,
addDefaultSetupDependencies
,
...
...
@@ -80,11 +72,10 @@ import Distribution.Client.Dependency.Types
import
Distribution.Client.Sandbox.Types
(
SandboxPackageInfo
(
..
)
)
import
Distribution.Client.Targets
import
qualified
Distribution.InstalledPackageInfo
as
Installed
import
Distribution.Package
(
PackageName
(
..
),
PackageIdentifier
(
PackageIdentifier
),
PackageId
,
Package
(
..
),
packageName
,
packageVersion
,
UnitId
,
Dependency
(
Dependency
))
,
Dependency
(
Dependency
))
import
qualified
Distribution.PackageDescription
as
PD
import
qualified
Distribution.PackageDescription.Configuration
as
PD
import
Distribution.PackageDescription.Configuration
...
...
@@ -363,17 +354,6 @@ addSourcePackages pkgs params =
(
depResolverSourcePkgIndex
params
)
pkgs
}
hideInstalledPackagesSpecificByUnitId
::
[
UnitId
]
->
DepResolverParams
->
DepResolverParams
hideInstalledPackagesSpecificByUnitId
pkgids
params
=
--TODO: this should work using exclude constraints instead
params
{
depResolverInstalledPkgIndex
=
foldl'
(
flip
InstalledPackageIndex
.
deleteUnitId
)
(
depResolverInstalledPkgIndex
params
)
pkgids
}
hideInstalledPackagesSpecificBySourcePackageId
::
[
PackageId
]
->
DepResolverParams
->
DepResolverParams
...
...
@@ -396,17 +376,6 @@ hideInstalledPackagesAllVersions pkgnames params =
}
hideBrokenInstalledPackages
::
DepResolverParams
->
DepResolverParams
hideBrokenInstalledPackages
params
=
hideInstalledPackagesSpecificByUnitId
pkgids
params
where
pkgids
=
map
Installed
.
installedUnitId
.
InstalledPackageIndex
.
reverseDependencyClosure
(
depResolverInstalledPkgIndex
params
)
.
map
(
Installed
.
installedUnitId
.
fst
)
.
InstalledPackageIndex
.
brokenPackages
$
depResolverInstalledPkgIndex
params
-- | Remove upper bounds in dependencies using the policy specified by the
-- 'AllowNewer' argument (all/some/none).
--
...
...
@@ -660,15 +629,7 @@ resolveDependencies platform comp pkgConfigDB solver params =
strFlags
maxBkjumps
enableBj
order
)
=
dontUpgradeNonUpgradeablePackages
-- TODO:
-- The modular solver can properly deal with broken
-- packages and won't select them. So the
-- 'hideBrokenInstalledPackages' function should be moved
-- into a module that is specific to the top-down solver.
.
(
if
solver
/=
Modular
then
hideBrokenInstalledPackages
else
id
)
$
params
order
)
=
dontUpgradeNonUpgradeablePackages
params
preferences
=
interpretPackagesPreference
(
Set
.
fromList
targets
)
defpref
prefs
...
...
Write
Preview
Markdown
is supported
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