Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
Cabal
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Glasgow Haskell Compiler
Packages
Cabal
Commits
8129e5ac
Commit
8129e5ac
authored
9 years ago
by
Mikhail Glushenkov
Browse files
Options
Downloads
Plain Diff
Merge pull request #2849 from bennofs/new-hackage-url
Always use new hackage URI
parents
2fc13703
d643a8ef
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
cabal-install/Distribution/Client/Config.hs
+5
-4
5 additions, 4 deletions
cabal-install/Distribution/Client/Config.hs
cabal-install/Distribution/Client/Upload.hs
+5
-13
5 additions, 13 deletions
cabal-install/Distribution/Client/Upload.hs
with
10 additions
and
17 deletions
cabal-install/Distribution/Client/Config.hs
+
5
−
4
View file @
8129e5ac
...
...
@@ -76,6 +76,8 @@ import Distribution.ParseUtils
,
parseFilePathQ
,
parseTokenQ
)
import
Distribution.Client.ParseUtils
(
parseFields
,
ppFields
,
ppSection
)
import
Distribution.Client.HttpUtils
(
isOldHackageURI
)
import
qualified
Distribution.ParseUtils
as
ParseUtils
(
Field
(
..
)
)
import
qualified
Distribution.Text
as
Text
...
...
@@ -503,10 +505,9 @@ defaultRemoteRepo = RemoteRepo name uri () False
--
addInfoForKnownRepos
::
RemoteRepo
->
RemoteRepo
addInfoForKnownRepos
repo
@
RemoteRepo
{
remoteRepoName
=
"hackage.haskell.org"
}
=
repo
{
--remoteRepoRootKeys --TODO: when this list is empty, fill in known crypto credentials
remoteRepoShouldTryHttps
=
True
}
tryHttps
$
if
isOldHackageURI
(
remoteRepoURI
repo
)
then
defaultRemoteRepo
else
repo
where
tryHttps
r
=
r
{
remoteRepoShouldTryHttps
=
True
}
addInfoForKnownRepos
other
=
other
--
...
...
This diff is collapsed.
Click to expand it.
cabal-install/Distribution/Client/Upload.hs
+
5
−
13
View file @
8129e5ac
...
...
@@ -5,7 +5,7 @@ module Distribution.Client.Upload (check, upload, report) where
import
Distribution.Client.Types
(
Username
(
..
),
Password
(
..
),
Repo
(
..
),
RemoteRepo
(
..
))
import
Distribution.Client.HttpUtils
(
isOldHackageURI
,
HttpTransport
(
..
),
remoteRepoTryUpgradeToHttps
)
(
HttpTransport
(
..
),
remoteRepoTryUpgradeToHttps
)
import
Distribution.Simple.Utils
(
notice
,
warn
,
info
,
die
)
import
Distribution.Verbosity
(
Verbosity
)
...
...
@@ -26,11 +26,6 @@ import Control.Monad (forM_, when)
type
Auth
=
Maybe
(
String
,
String
)
--FIXME: how do we find this path for an arbitrary hackage server?
-- is it always at some fixed location relative to the server root?
legacyUploadURI
::
URI
Just
legacyUploadURI
=
parseURI
"http://hackage.haskell.org/cgi-bin/hackage-scripts/protected/upload-pkg"
checkURI
::
URI
Just
checkURI
=
parseURI
"http://hackage.haskell.org/cgi-bin/hackage-scripts/check-pkg"
...
...
@@ -41,13 +36,10 @@ upload transport verbosity repos mUsername mPassword paths = do
[]
->
die
$
"Cannot upload. No remote repositories are configured."
rs
->
remoteRepoTryUpgradeToHttps
transport
(
last
rs
)
let
targetRepoURI
=
remoteRepoURI
targetRepo
uploadURI
|
isOldHackageURI
targetRepoURI
=
legacyUploadURI
|
otherwise
=
targetRepoURI
{
uriPath
=
uriPath
targetRepoURI
FilePath
.
Posix
.</>
"upload"
}
rootIfEmpty
x
=
if
null
x
then
"/"
else
x
uploadURI
=
targetRepoURI
{
uriPath
=
rootIfEmpty
(
uriPath
targetRepoURI
)
FilePath
.
Posix
.</>
"upload"
}
Username
username
<-
maybe
promptUsername
return
mUsername
Password
password
<-
maybe
promptPassword
return
mPassword
let
auth
=
Just
(
username
,
password
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment