Skip to content
GitLab
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
7fa5e2a7
Commit
7fa5e2a7
authored
Oct 14, 2007
by
Duncan Coutts
Browse files
Improve the error message we get when missing the package index file
parent
95c12e57
Changes
1
Hide whitespace changes
Inline
Side-by-side
cabal-install/Hackage/Config.hs
View file @
7fa5e2a7
...
...
@@ -93,14 +93,11 @@ readRepoIndex :: ConfigFlags -> Repo -> IO [PkgInfo]
readRepoIndex
cfg
repo
=
do
let
indexFile
=
repoCacheDir
cfg
repo
</>
"00-index.tar"
fmap
(
parseRepoIndex
repo
)
(
BS
.
readFile
indexFile
)
`
catch
`
(
\
e
->
do
hPutStrLn
stderr
(
"Warning: Problem opening package list '"
++
indexFile
++
"'."
)
case
e
of
IOException
ioe
|
isDoesNotExistError
ioe
->
hPutStrLn
stderr
"File doesn't exist. Run 'cabal-install update' to create the package list."
_
->
hPutStrLn
stderr
(
"Error: "
++
(
show
e
))
return
[]
)
`
catch
`
(
\
e
->
do
case
e
of
IOException
ioe
|
isDoesNotExistError
ioe
->
hPutStrLn
stderr
"The package list does not exist. Run 'cabal update' to download it."
_
->
hPutStrLn
stderr
(
"Error: "
++
show
e
)
return
[]
)
parseRepoIndex
::
Repo
->
ByteString
->
[
PkgInfo
]
parseRepoIndex
repo
s
=
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment