Skip to content
Snippets Groups Projects
Commit 29bd5aaf authored by Edsko de Vries's avatar Edsko de Vries Committed by Benno Fünfstück
Browse files

Change old Hackage URIs to new Hackage URIs

This is necessary because otherwise doing a secure update will result in errors
such as

Unexpected response (4,0,4)for http://hackage.haskell.orgpackages/archive/root.json

Alternative we could set up redirections for these in Hackage, but what's the
point?
parent 5c18873b
No related branches found
No related tags found
No related merge requests found
...@@ -76,6 +76,8 @@ import Distribution.ParseUtils ...@@ -76,6 +76,8 @@ import Distribution.ParseUtils
, parseFilePathQ, parseTokenQ ) , parseFilePathQ, parseTokenQ )
import Distribution.Client.ParseUtils import Distribution.Client.ParseUtils
( parseFields, ppFields, ppSection ) ( parseFields, ppFields, ppSection )
import Distribution.Client.HttpUtils
( isOldHackageURI )
import qualified Distribution.ParseUtils as ParseUtils import qualified Distribution.ParseUtils as ParseUtils
( Field(..) ) ( Field(..) )
import qualified Distribution.Text as Text import qualified Distribution.Text as Text
...@@ -503,10 +505,9 @@ defaultRemoteRepo = RemoteRepo name uri () False ...@@ -503,10 +505,9 @@ defaultRemoteRepo = RemoteRepo name uri () False
-- --
addInfoForKnownRepos :: RemoteRepo -> RemoteRepo addInfoForKnownRepos :: RemoteRepo -> RemoteRepo
addInfoForKnownRepos repo@RemoteRepo{ remoteRepoName = "hackage.haskell.org" } = addInfoForKnownRepos repo@RemoteRepo{ remoteRepoName = "hackage.haskell.org" } =
repo { tryHttps $ if isOldHackageURI (remoteRepoURI repo) then defaultRemoteRepo else repo
--remoteRepoRootKeys --TODO: when this list is empty, fill in known crypto credentials where
remoteRepoShouldTryHttps = True tryHttps r = r { remoteRepoShouldTryHttps = True }
}
addInfoForKnownRepos other = other addInfoForKnownRepos other = other
-- --
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment