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
82322e78
Commit
82322e78
authored
Aug 12, 2008
by
Duncan Coutts
Browse files
Clean up some warnings
parent
cab1460f
Changes
2
Hide whitespace changes
Inline
Side-by-side
cabal-install/Distribution/Client/BuildReports/Upload.hs
View file @
82322e78
...
...
@@ -55,6 +55,7 @@ postBuildReport uri buildReport = do
putBuildLog
::
BuildReportId
->
BuildLog
->
BrowserAction
()
putBuildLog
reportId
buildLog
=
do
--FIXME: do something if the request fails
(
_
,
response
)
<-
request
Request
{
rqURI
=
reportId
{
uriPath
=
uriPath
reportId
</>
"buildlog"
},
rqMethod
=
PUT
,
...
...
cabal-install/Distribution/Client/Upload.hs
View file @
82322e78
...
...
@@ -13,7 +13,6 @@ import Distribution.Client.Config
import
qualified
Distribution.Client.BuildReports.Anonymous
as
BuildReport
import
qualified
Distribution.Client.BuildReports.Upload
as
BuildReport
import
qualified
Distribution.Client.BuildReports.Storage
as
BuildReport
import
Network.Browser
(
BrowserAction
,
browse
,
request
...
...
@@ -30,8 +29,8 @@ import System.IO (hFlush, stdin, stdout, hGetEcho, hSetEcho
,
openBinaryFile
,
IOMode
(
ReadMode
),
hGetContents
)
import
Control.Exception
(
bracket
)
import
System.Random
(
randomRIO
)
import
System.FilePath
import
qualified
System.FilePath.Posix
as
FilePath.Posix
import
System.FilePath
((
</>
),
takeExtension
)
import
qualified
System.FilePath.Posix
as
FilePath.Posix
(
combine
)
import
System.Directory
import
Control.Monad
(
forM_
)
...
...
@@ -62,7 +61,7 @@ upload verbosity repos mUsername mPassword paths = do
notice
verbosity
$
"Uploading "
++
path
++
"... "
handlePackage
verbosity
uploadURI
auth
path
where
targetRepoURI
=
remoteRepoURI
$
selectUploadRepo
[
remoteRepo
|
Left
remoteRepo
<-
map
repoKind
repos
]
targetRepoURI
=
remoteRepoURI
$
last
[
remoteRepo
|
Left
remoteRepo
<-
map
repoKind
repos
]
--FIXME: better error message when no repos are given
promptUsername
::
IO
Username
promptUsername
=
do
putStr
"Hackage username: "
...
...
@@ -78,8 +77,6 @@ upload verbosity repos mUsername mPassword paths = do
hSetEcho
stdin
False
-- no echoing for entering the password
fmap
Password
getLine
selectUploadRepo
=
last
-- Use head?
report
::
Verbosity
->
[
Repo
]
->
IO
()
report
verbosity
repos
=
forM_
repos
$
\
repo
->
...
...
@@ -93,9 +90,9 @@ report verbosity repos
let
(
reportStr
,
buildLog
)
=
read
inp
::
(
String
,
String
)
case
BuildReport
.
parse
reportStr
of
Left
errs
->
do
warn
verbosity
$
"Errors: "
++
errs
-- FIXME
Right
report
->
do
info
verbosity
$
"Uploading report for "
++
display
(
BuildReport
.
package
report
)
browse
$
BuildReport
.
uploadReports
(
remoteRepoURI
remoteRepo
)
[(
report
,
Just
buildLog
)]
Right
report
'
->
do
info
verbosity
$
"Uploading report for "
++
display
(
BuildReport
.
package
report
'
)
browse
$
BuildReport
.
uploadReports
(
remoteRepoURI
remoteRepo
)
[(
report
'
,
Just
buildLog
)]
return
()
Right
{}
->
return
()
...
...
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