Commit 563fd590 authored by Mikhail Glushenkov's avatar Mikhail Glushenkov

Rename 'relaxUpperBound' to 'removeUpperBound'.

parent d87b584b
......@@ -69,7 +69,7 @@ module Distribution.Version (
foldVersionRange',
-- ** Modification
relaxUpperBound,
removeUpperBound,
-- * Version intervals view
asVersionIntervals,
......@@ -242,8 +242,8 @@ betweenVersionsInclusive v1 v2 =
-- | Given a version range, remove the highest upper bound. Example: @(>= 1 && <
-- 3) || (>= 4 && < 5)@ is converted to @(>= 1 && < 3) || (>= 4)@.
relaxUpperBound :: VersionRange -> VersionRange
relaxUpperBound = fromVersionIntervals . relaxLastInterval . toVersionIntervals
removeUpperBound :: VersionRange -> VersionRange
removeUpperBound = fromVersionIntervals . relaxLastInterval . toVersionIntervals
where
relaxLastInterval (VersionIntervals intervals) =
VersionIntervals (relaxLastInterval' intervals)
......
......@@ -149,8 +149,8 @@ planLocalPackage verbosity comp platform configFlags configExFlags installedPkgI
fromFlagOrDefault False $ configBenchmarks configFlags
resolverParams =
relaxUpperBounds (fromFlagOrDefault AllowNewerNone $
configAllowNewer configExFlags)
removeUpperBounds (fromFlagOrDefault AllowNewerNone $
configAllowNewer configExFlags)
. addPreferences
-- preferences from the config file or command line
......
......@@ -55,7 +55,7 @@ module Distribution.Client.Dependency (
hideInstalledPackagesSpecificByInstalledPackageId,
hideInstalledPackagesSpecificBySourcePackageId,
hideInstalledPackagesAllVersions,
relaxUpperBounds
removeUpperBounds
) where
import Distribution.Client.Dependency.TopDown
......@@ -88,7 +88,7 @@ import Distribution.PackageDescription (BuildInfo(targetBuildDepends))
import Distribution.PackageDescription.Configuration (mapCondTree)
import Distribution.Version
( Version(..), VersionRange, anyVersion, thisVersion, withinRange
, relaxUpperBound, simplifyVersionRange )
, removeUpperBound, simplifyVersionRange )
import Distribution.Compiler
( CompilerId(..), CompilerFlavor(..) )
import Distribution.System
......@@ -290,12 +290,12 @@ hideBrokenInstalledPackages params =
. InstalledPackageIndex.brokenPackages
$ depResolverInstalledPkgIndex params
-- | Relax upper bounds in dependencies using the policy specified by the
-- | Remove upper bounds in dependencies using the policy specified by the
-- 'AllowNewer' argument (all/some/none).
relaxUpperBounds :: AllowNewer -> DepResolverParams -> DepResolverParams
relaxUpperBounds allowNewer params =
removeUpperBounds :: AllowNewer -> DepResolverParams -> DepResolverParams
removeUpperBounds allowNewer params =
params {
-- NB: It's important to apply 'relaxUpperBounds' after
-- NB: It's important to apply 'removeUpperBounds' after
-- 'addSourcePackages'. Otherwise, the packages inserted by
-- 'addSourcePackages' won't have upper bounds in dependencies relaxed.
......@@ -312,14 +312,14 @@ relaxUpperBounds allowNewer params =
relaxAllPackageDeps = onAllBuildDepends doRelax
where
doRelax (Dependency pkgName verRange) =
Dependency pkgName (relaxUpperBound verRange)
Dependency pkgName (removeUpperBound verRange)
relaxSomePackageDeps :: [PackageName] -> SourcePackage -> SourcePackage
relaxSomePackageDeps pkgNames = onAllBuildDepends doRelax
where
doRelax d@(Dependency pkgName verRange)
| pkgName `elem` pkgNames = Dependency pkgName
(relaxUpperBound verRange)
(removeUpperBound verRange)
| otherwise = d
-- Walk a 'GenericPackageDescription' and apply 'f' to all 'build-depends'
......
......@@ -334,7 +334,7 @@ planPackages comp platform mSandboxPkgInfo solver
. setPreferenceDefault (if upgradeDeps then PreferAllLatest
else PreferLatestForSelected)
. relaxUpperBounds allowNewer
. removeUpperBounds allowNewer
. addPreferences
-- preferences from the config file or command line
......
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