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
72aed5f4
Commit
72aed5f4
authored
Oct 19, 2014
by
Duncan Coutts
Browse files
Merge pull request #2090 from 23Skidoo/no-update-check
Remove the self-upgrade check.
parents
cfda520f
b5bbf5ac
Changes
1
Show whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/Update.hs
View file @
72aed5f4
...
...
@@ -15,21 +15,14 @@ module Distribution.Client.Update
)
where
import
Distribution.Client.Types
(
Repo
(
..
),
RemoteRepo
(
..
),
LocalRepo
(
..
)
,
SourcePackageDb
(
..
)
)
(
Repo
(
..
),
RemoteRepo
(
..
),
LocalRepo
(
..
)
)
import
Distribution.Client.HttpUtils
(
DownloadResult
(
..
)
)
import
Distribution.Client.FetchUtils
(
downloadIndex
)
import
qualified
Distribution.Client.PackageIndex
as
PackageIndex
import
Distribution.Client.IndexUtils
(
getSourcePackages
,
updateRepoIndexCache
)
import
qualified
Paths_cabal_install
(
version
)
(
updateRepoIndexCache
)
import
Distribution.Package
(
PackageName
(
..
),
packageVersion
)
import
Distribution.Version
(
anyVersion
,
withinRange
)
import
Distribution.Simple.Utils
(
writeFileAtomic
,
warn
,
notice
)
import
Distribution.Verbosity
...
...
@@ -37,12 +30,7 @@ import Distribution.Verbosity
import
qualified
Data.ByteString.Lazy
as
BS
import
Distribution.Client.GZipUtils
(
maybeDecompress
)
import
qualified
Data.Map
as
Map
import
System.FilePath
(
dropExtension
)
import
Data.List
(
intercalate
)
import
Data.Maybe
(
fromMaybe
)
import
Data.Version
(
showVersion
)
import
Control.Monad
(
unless
)
-- | 'update' downloads the package list from all known servers
update
::
Verbosity
->
[
Repo
]
->
IO
()
...
...
@@ -51,7 +39,6 @@ update verbosity [] =
++
"you would have one specified in the config file."
update
verbosity
repos
=
do
mapM_
(
updateRepo
verbosity
)
repos
checkForSelfUpgrade
verbosity
repos
updateRepo
::
Verbosity
->
Repo
->
IO
()
updateRepo
verbosity
repo
=
case
repoKind
repo
of
...
...
@@ -66,27 +53,3 @@ updateRepo verbosity repo = case repoKind repo of
writeFileAtomic
(
dropExtension
indexPath
)
.
maybeDecompress
=<<
BS
.
readFile
indexPath
updateRepoIndexCache
verbosity
repo
checkForSelfUpgrade
::
Verbosity
->
[
Repo
]
->
IO
()
checkForSelfUpgrade
verbosity
repos
=
do
SourcePackageDb
sourcePkgIndex
prefs
<-
getSourcePackages
verbosity
repos
let
self
=
PackageName
"cabal-install"
preferredVersionRange
=
fromMaybe
anyVersion
(
Map
.
lookup
self
prefs
)
currentVersion
=
Paths_cabal_install
.
version
laterPreferredVersions
=
[
version
|
pkg
<-
PackageIndex
.
lookupPackageName
sourcePkgIndex
self
,
let
version
=
packageVersion
pkg
,
version
>
currentVersion
,
version
`
withinRange
`
preferredVersionRange
]
unless
(
null
laterPreferredVersions
)
$
mapM_
(
notice
verbosity
)
[
"Note: You are not currently running the latest version of cabal-install."
,
"The currently running version is: "
++
showVersion
currentVersion
,
"These available versions are newer: "
++
(
intercalate
", "
.
map
showVersion
)
laterPreferredVersions
,
"If you have already installed a newer version, and intended "
++
"to run it, maybe check your PATH environment variable?"
]
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