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
60963078
Commit
60963078
authored
Mar 17, 2016
by
Mikhail Glushenkov
Browse files
80-col violations.
parent
635a3a3f
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/GenBounds.hs
View file @
60963078
...
...
@@ -111,34 +111,23 @@ genBounds verbosity packageDBs repoCtxt comp platform conf mSandboxPkgInfo
case
epd
of
Left
_
->
putStrLn
"finalizePackageDescription failed"
Right
(
pd
,
_
)
->
do
let
needBounds
=
filter
(
not
.
hasUpperBound
.
depVersion
)
$
buildDepends
pd
let
needBounds
=
filter
(
not
.
hasUpperBound
.
depVersion
)
$
buildDepends
pd
if
(
null
needBounds
)
then
putStrLn
"Congratulations, all your dependencies have upper bounds!"
then
putStrLn
"Congratulations, all your dependencies have upper bounds!"
else
go
needBounds
where
go
needBounds
=
do
pkgs
<-
getFreezePkgs
verbosity
packageDBs
repoCtxt
comp
platform
conf
mSandboxPkgInfo
globalFlags
freezeFlags
verbosity
packageDBs
repoCtxt
comp
platform
conf
mSandboxPkgInfo
globalFlags
freezeFlags
putStrLn
$
unlines
[
""
,
"The following packages need bounds and here is a suggested starting point."
,
"You can copy and paste this into the build-depends section in your .cabal"
,
"file and it should work (with the appropriate removal of commas)."
,
""
,
"Note that version bounds are a statement that you've successfully built and"
,
"tested your package and expect it to work with any of the specified package"
,
"versions (PROVIDED that those packages continue to conform with the PVP)."
,
"Therefore, the version bounds generated here are the most conservative"
,
"based on the versions that you are currently building with. If you know"
,
"your package will work with versions outside the ranges generated here,"
,
"feel free to widen them."
,
""
]
putStrLn
boundsNeededMsg
let
isNeeded
pkg
=
unPackageName
(
packageName
pkg
)
`
elem
`
map
depName
needBounds
let
isNeeded
pkg
=
unPackageName
(
packageName
pkg
)
`
elem
`
map
depName
needBounds
let
thePkgs
=
filter
isNeeded
pkgs
let
padTo
=
maximum
$
map
(
length
.
unPackageName
.
packageName
)
pkgs
...
...
@@ -149,3 +138,22 @@ genBounds verbosity packageDBs repoCtxt comp platform conf mSandboxPkgInfo
depVersion
::
Dependency
->
VersionRange
depVersion
(
Dependency
_
vr
)
=
vr
-- | The message printed when some dependencies are found to be lacking proper
-- PVP-mandated bounds.
boundsNeededMsg
::
String
boundsNeededMsg
=
unlines
[
""
,
"The following packages need bounds and here is a suggested starting point."
,
"You can copy and paste this into the build-depends section in your .cabal"
,
"file and it should work (with the appropriate removal of commas)."
,
""
,
"Note that version bounds are a statement that you've successfully built and"
,
"tested your package and expect it to work with any of the specified package"
,
"versions (PROVIDED that those packages continue to conform with the PVP)."
,
"Therefore, the version bounds generated here are the most conservative"
,
"based on the versions that you are currently building with. If you know"
,
"your package will work with versions outside the ranges generated here,"
,
"feel free to widen them."
,
""
]
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